Mysql installation, mysql
1. Install Mysql
1. Run cmd (administrator Version, otherwise you do not have permission) to switch to the mysql bin directory.
2. Run the command mysqld-install to install the service.
3. If you do not need mysql, you only need to run mysqld-remove to remove it.
4. Run net start mysql to start the service and run net stop mysql to stop the service.
5. Run mysql-uroot-p. The default password is empty for logon.
6. Set character encoding
Client
[Mysql]
Default-character-set = utf8
[Mysqld]
Character_set_server = utf8
7. Run the command show variables like "% character %"; view the system character set variables (the semicolons must not be less)
8. use mysql to switch Databases
UPDATE user SETPassword = PASSWORD ('000000') WHERE user = 'root'; Change PASSWORD
Flush privileges; refresh the page for the set password to take effect
Exit
Mysql-uroot-p123456 Log On with the SET Password
1. Create a database
Create database oa;
Use oa;
Ii. Create a table
Create table t_user (
Id int primary key auto_increment,
Username varchar (20 ),
Sex varchar (20)
);
Select * from t_user;
3. insert
Insert into t_user (username, sex) values ('xiaoming ', 'male shy ');
Insert into t_user (username, sex) values ('little red', 'female shilles ');