MySQL additions and deletions--the change

Source: Internet
Author: User

MySQL change data 1, set the root (database) user's login password

Mysqladmin-uroot password "123"

2. Change the root user login password

mysqladmin-uroot-p123 password "[email protected]"

3, change the user password in the database (this is the root user)

Mysql> ALTER USER ' root ' @ ' localhost ' identified by ' 1234 ';

4, Update table records the Update table name set field name = value,... where conditional expression;

(1) The user table is under the current path Numer 1 update password is 321
Update user set User_passwd=password (' 321 ') where number= ' 1 ';

(2) The path specified in the current path of the user table will be numer to 1 update password 321
Update Hehe.user Set User_passwd=password (' 321 ') where number= ' 1 ';

Note: Update records suggest that the primary key is the update condition

5. Change the language used by the database

mysql> set character_set_client = UTF8;

6. Change the existing storage engine in the table

mysql> ALTER TABLE name engine= engine;

7. Specify database default storage engine for new table

Vim/etc/my.cnf

8. Change all tables under the specified library (two ways)

(1) Change the storage engine for all tables (or specified tables under specified libraries) under the specified library;
Mysql_convert_table_format--user= user--password= ' password '--socket=/var/lib/mysql/mysql.sock--type= engine library name [table name]

(2) Change the storage engine for all tables (or specified tables under specified libraries) under the specified library;
Mysql_convert_table_format--user= user--password= ' password '--socket=/usr/local/mysql/data/mysql.sock--type= engine library name [table name]

MySQL additions and deletions--the change

Related Article

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.