MySQL installation and several common commands

Source: Internet
Author: User

1. Install

Sudo apt-Get install mysql-server mysql-Admin mysql-query-brower

Default users:
User: Root
PWD: NULL

2. Some commands

1) Enable and disable

Sudo mysqld
Sudo mysqladmin Shutdown

2) connect to SQL

Mysql-H localhost-uroot-P 123

3) change the password

Mysqladmin-uroot-P 123 password New Password

4) Add a user

Mysql-uroot-p123
Mysql> grant select, insert, update, delete on *. * To test1 @ "%" identified by "ABC ";
(The query, update, and delete functions are available on all tables. you can log on to the table at any location. The password is ABC and the account is test1)

Mysql> grant select, insert, update, delete on mydatabase to newglad @ localhost identified by "Mima"
(You can only log on locally. You can only modify, query, and delete mydatabase. You can use the newglad password Mima)

Oh, I only know this for the time being.

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.