MySQL personal scattered notes, careful reference

Source: Internet
Author: User

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

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.