MySQL notes

xiaoxiao2021-03-06  33

Forgot Mysql's root password: first confirm that the mysqld process has been killed, then execute this / usr / bin / safe_mysqld --skip-grant-tables & thus logging in to mysql -h 192.168.1.2 -u root 192.168.1.2 is Cloud's mysqld running machine, you change to yourself, so you can change your password. Modify password 1.mysql -h hostname -u root command logs in to mysqld server with grant command to change your password: grant all on *. * To root, ing on *. 111111 "2. MySQLADMIN -U username -P old password Password new password case 1: Add a password to the root AB12. First enter the directory mysqlbin under DOS, then type the following command mysqladmin -uroot password AB12 Note: Because the root does not have a password, the -p old password can be omitted. 2, Example 2: Change the root password to DJG345. MySQLADMIN -U ROOT -PAB12 Password DJG345 (Note -P Don't write separately from the back password, you want to write together) 3. Use mysql; update user set password = password ('Yourpass') where user = 'r OOT' 4. Load Permissions: `mysqladmin -h hostname flush-privileges ', or use SQL commands` flush privileges'. (Of course, here, you can also restart mysqld.) MySQL's construction library, add data method: mysqi -u root mysql> create database ttt; mysql> source 1.txt mysql> load data local infile "2.txt" INTO Table board; 1.TXT content: Create Table Board (BoardId Int (11) Not Null Auto_Increment, BoardName Char (255), Primary Key (BoardID)); 2.TXT Content: 1 LK (Tab Key Fault) 2 LKLK 3 LKLKLK Export Database: #mysqldump -opt ttt -uroot -p111111> 111.sql import database 1. # mysql -u root -p111111 ttt <111.sql 2. mysql> source 111.sql; export multiple Database: #mysqldump - -Databases ttt1 ttt2 ttt3 -uroot -p111111> 111.sql export all Database: #mysqldump --all-catabases-uroot -p111111> 111.sql

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

New Post(0)