MySQL basic instruction

xiaoxiao2021-03-06  39

Instruction mode

Set mysql management password mysqladmin -u root password '12345' Display data table structure, Data database mysqlshow data Display data sheet structure, Data database 123 data table MysqlShow Data 123

Reset AUTO_INCREMENT value

Alter Table Tabellenname Auto_Increme = 0

Transfer text file into the database

Load data infile "/Home/web/www/a.txt" INTO TABLE CUSTOM FIELDS TERMINATED BY ', "

Modify the user password

#mysql -p

> USE MYSQL

> Update User Set Password = Password ('new password') where user = 'new user';

> Flush Privileges;

Forget the root password

Killall mysqld

Mysqld -u root --skip-grant-Tables &

mysql

> Use mysql> Update user set password = password ('new password') where user = 'root';> flush privilegegg;

Calculation information table

$ results = "Select Count (ID) as abc from board_hoyo"; $ SQL = mysql_query ($ RESULT); $ row = mysql_fetch_object ($ SQL); Echo $ ROW-> ABC;

.my.cnf "can automatically use account password"

[client] Host = computer name, generally filling the localhostuser = user name, usually a rootpassword = password, according to the password set by the self

Edit the information in advance

Under MySQL mode, you have to create a complex information, it is easy, so we can edit the data sheet you want to build first into a text file, then use the MySQL instruction to make an email!

MySQL book

转载请注明原文地址:https://www.9cbs.com/read-77532.html

New Post(0)