MySQL Learning notes
Select substring (now (), 1,10);
MySQL landed capital Letter P is port
C:\Program Files\mysql\mysql Server 5.6\bin>
Mysql-h 127.0.0.1-p-U root-p
Set the password for the root account
mysql> set password for ' XP ' @ ' 127.0.0.1 ' =password (' xp132018 ');
Change Password:
C:\Program files\mysql\mysql Server 5.6\bin>mysqladmin-u root-ppasswd Password ABC
MySQL Database remote:
Grant all privileges on * * to ' root ' @ ' 192.168.0.% ' identified by ' 3613571 ';
Flush privileges;
(The first * is the database, the second * represents the table in the database, the win represents the account, the% represents the IP address, the win456 represents the account password)
show databases;
Use Td_oa;
Show tables;
select * from user;
SELECT * to OutFile ' d:/test.xls ' from table name
CREATE TABLE aaa (ID INT (one), NAME varchar (255));
INSERT into student values (' 102 ', ' John Doe ', ' eight Grade ');
drop table student; Delete a table
Backup of the database
C:\Program files\mysql\mysql Server 5.5\bin>mysqldump.exe-u root-p mysql student > mysql_bak.sql (Backup of the specified MySQL database s Tudent table)
Mysqldump.exe-u root-p mysql > mysql_bak.sql (Backup Database for all tables in MySQL)
Restoring a Database
C:\Program files\mysql\mysql Server 5.5\bin>mysql-u root-p MySQL < Mysql_bak.sql
Grant Replication Slave on * * to ' XP ' @ ' 192.168.1.9 ' identified by ' xp456 ' with GRANT option;
Change Master to master_host= ' 192.168.1.10 ', master_user= ' XP ', master_password= ' xp456 ', master_log_file= ' mysql-bin.000013 ', master_log_pos=107;
Installation of the MySQL service
Mysqld--install MySQL--defaults-file=d:\hyk\mysql55\my.ini
net start MySQL
Uninstall the MySQL service
net stop MySQL
Mysqld-remove
This article from "Faith Connaught" blog, declined reprint!
MySQL personal scattered notes, careful reference