Common operations for MySQL database under Linux

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.