SSH management tool to connect to MySQL database.
One. Connect to MySQL database:
Through the SHH management tool, login to the Linux user name, password, enter the command line interface of SSH, execute the following command:
Mysql-u database user name-P then enter
Enter the password for the corresponding database and connect to the MySQL database.
Two. Back up the MySQL database
Mysqldump-u database user name-p backup database name > Tm_050519.sql
The default backup is to the directory where the current user resides. or global lookups through Find-name tm_050519.sql.
Three. Common operations in MySQL.
1. Select the database:
Use database name
To delete a database:
Drop database name
2. Show all the tables
Show tables;
3. Query, modify, delete
SELECT * FROM table name
Update table name set field name = ' '
Delete from table name
Delete a column in a table
ALTER TABLE DROP Column name
4.mysql Restart of service
/etc/init.d/mysql restart
Four. The data tables in the MySQL database in the Linux system are exported into table graphs (MySQL
1. Back up the MySQL database, see the commands in the backup.
2. Open the local MySQL database, then open the Backup SQL script, select an empty database, set the default, and then execute the backup SQL script.
3. Locate the Database menu for the MySQL databases, and then find the reverse Engineer below it, and follow the steps of the boot step, you can go around the diagram between the data tables.
Common operations for MySQL database under Linux