![]() ![]()
SQLITEMANAGER COMMANDS TO SEE DATABASE STRUCTURE SOFTWAREThese software work on macOS, Windows, Linux and most of the Unix Operating systems. SQLITEMANAGER COMMANDS TO SEE DATABASE STRUCTURE FOR FREEThen here is a shortlist of the SQLite Editor that is available on the web for free download. for free commercial or non-commercial use. SQLITEMANAGER COMMANDS TO SEE DATABASE STRUCTURE LICENSE# /bin/mysql -u username -ppassword databasename CREATE TABLE (firstname VARCHAR(20), middleinitial VARCHAR(3), lastname VARCHAR(35),suffix VARCHAR(3),officeid VARCHAR(10),userid VARCHAR(15),username VARCHAR(8),email VARCHAR(35),phone VARCHAR(25), groups VARCHAR(15),datestamp DATE,timestamp time,pgpemail VARCHAR(255)) Create Table Example 2.If you are looking for an SQLite Editor in the public domain under Creative Commons license or GPL (General Public License) i.e. # /bin/mysqldump -c -u username -ppassword databasename tablename > /tmp/ Restore database (or database table) from backup. # /bin/mysqldump -u username -ppassword –databases databasename >/tmp/databasename.sql Dump a table from a database. # /bin/mysqldump -u root -ppassword –opt >/tmp/alldatabases.sql Dump one database for backup. Backup file is sql commands to recreate all db’s. ‘ (field1,field2,field3) Dump all databases for backup. Mysql> LOAD DATA INFILE ‘/tmp/filename.csv’ replace INTO TABLE FIELDS TERMINATED BY ‘,’ LINES TERMINATED BY ‘ Mysql> alter table drop index Load a CSV file into a table. Mysql> alter table modify VARCHAR(3) Delete unique from table. Mysql> alter table add unique () Make a column bigger. Mysql> alter table change varchar (50) Make a unique column so you get no dupes. Mysql> alter table add column varchar (20) Change column name. Mysql> alter table drop column Add a new column to db. SQLITEMANAGER COMMANDS TO SEE DATABASE STRUCTURE UPDATEMysql> DELETE from where = ‘whatever’ Update database permissions/privilages. Mysql> UPDATE SET Select_priv = ‘Y’,Insert_priv = ‘Y’,Update_priv = ‘Y’ where = ‘user’ Delete a row(s) from a table. Mysql> grant all privileges on databasename.* to flush privileges To update info already in a table. Mysql> INSERT INTO db (Host,Db,User,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv) VALUES (‘%’,’databasename’,’username’,’Y’,’Y’,’Y’,’Y’,’Y’,’N’) Mysql> flush privileges Give user privilages for a db. Mysql> grant usage on *.* to identified by ‘passwd’ SQLITEMANAGER COMMANDS TO SEE DATABASE STRUCTURE PASSWORD# mysqladmin -u root -p oldpassword newpassword Allow the user “bob” to connect to the server from localhost using the password “passwd”. # mysqladmin -u root password newpassword Update a root password. # /etc/init.d/mysql start Set a root password if there is on root password. Mysql> update user set password=PASSWORD(“newrootpassword”) where User=’root’ Mysql> flush privileges Recover a MySQL root password. Mysql> SET PASSWORD FOR = PASSWORD(‘passwordhere’) # /bin/mysqladmin -u username -h -p password ‘new-password’ Change a users password from MySQL prompt. Mysql> flush privileges Change a users password from unix shell. Mysql> INSERT INTO user (Host,User,Password) VALUES(‘%’,’username’,PASSWORD(‘password’)) Mysql> select lookup.illustrationid, lookup.personid,person.birthday from lookup left join person on lookup.personid=person.personid=statement to join birthday in person table with primary illustration id Creating a new user. Mysql> SELECT SUM(*) FROM Join tables on common columns. Mysql> SELECT, FROM ORDER BY DESC Return number of rows. Mysql> SELECT DISTINCT FROM Show selected records sorted in an ascending (asc) or descending (desc). Mysql> SELECT * FROM WHERE rec RLIKE “^a” Show unique records. Use “REGEXP BINARY” to force case-sensitivity. Mysql> SELECT * FROM WHERE name like “Bob%” AND phone_number = ‘3444444’ limit 1,5 Use a regular expression to find records. Mysql> SELECT * FROM WHERE name like “Bob%” AND phone_number = ‘3444444’ Show all records starting with the letters ‘bob’ AND the phone number ‘3444444’ limit to records 1 through 5. Mysql> SELECT * FROM WHERE name != “Bob” AND phone_number = ‘3444444’ order by phone_number Show all records starting with the letters ‘bob’ AND the phone number ‘3444444’. Mysql> SELECT * FROM WHERE name = “Bob” AND phone_number = ‘3444444’ Show all records not containing the name “Bob” AND the phone number ‘3444444’ order by the phone_number field. Mysql> SELECT * FROM WHERE = “whatever” Show all records containing the name “Bob” AND the phone number ‘3444444’. Mysql> show columns from Show certain selected rows with the value “whatever”. Mysql> SELECT * FROM Returns the columns and column information pertaining to the designated table. Mysql> drop table Show all data in a table. Mysql> show tables To see database’s field formats. Mysql> use To see all the tables in the db. Mysql> show databases Switch to a database. Mysql> create database List all databases on the sql server. # /bin/mysql -h hostname -u root -p Create a database on the sql server. To login (from unix shell) use -h only if needed. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |