MySQL Common commands

Source: Internet
Author: User

1, source package installation MySQL directly into not go, need to do environment variables, in the/etc/profile file add Path=/usr/local/mysql/bin: $PATH

Export path two lines of command, using Surce/etc/profile reload environment variables, if you do not understand please see the article source installation MySQL.

2, access to the database command: the first access to the data by default no password, direct MySQL directly into the database is the most important core, usually using the password, the first command to set the password is: mysqldump-uroot-password password, The command to enter the database is: Msyql-uroot-p Enter the password can be

3. The command of the new database is: Create database name; View the database command that already exists in the database: show databases; the command to enter a database is the use database name; the command to view tables that already exist in the database is: show tables The command to view the table structure is: DESC table name; View a table's contents as: SELECT * from table name where condition; If you view everything inside the table, do not add a where condition.

4: The command to delete the database is: drop database name; NOTE!!! Delete with truncate deletes the table data and does not delete the table, and the drop table structure is deleted

Don't like to spray!!!!!!!!!!!

MySQL Common commands

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.