Install MySQL5.6 and modify the root password.
1. After MySQL5.6 is installed, MySQL cannot be enabled properly. 1. After decompression, go to my computer> Properties> advanced> environment variables.
Select PATH and add the PATH of the mysql bin folder (for example, C: \ Program Files \ MySQL Server 5.6 \ bin)
2. modify or add configuration in the my-default.ini:
[Mysqld]
Basedir = C: \ Program Files \ MySQL Server 5.6 (mysql directory)
Datadir = C: \ Program Files \ MySQL Server 5.6 \ data (mysql directory \ data)
Port = 3306
3. Run cmd as an administrator and enter mysqld-install
4. After the installation is successful, start the service. In cmd, enter net start mysql (). The service starts successfully!
5. After the service is successfully started, you can log on. Enter mysql-u root-p (no password for the first login, press Enter!
Ii. MySQL5.6 forget the root password 1. First, net stop mysql service and switch to the task manager. It is recommended that you close the process if it is related to mysql.
2. Run the CMD command to switch to the MySql installation bin directory and execute mysqld -- skip-grant-tables (note that there is no semicolon next)
3. Do not close the command line window and open a new command line window again. Note: At this time, a warning may appear, so ignore it.
4. Open a new cmd window again. Run the following command in the bin directory: mysql-u root-p. Enter the password and press Enter.
5. Execute the command: update mysql. user set password = PASSWORD ('root') where User = 'root ';
6. Refresh and execute: mysql> flush privileges;
7. Close the window and log on
3. create a user and grant certain permissions (with the select, delete, update, create, and drop permissions). 1. log on to the user with all permissions.
2. Create a user: mysql> insert into mysql. User (Host, user, Password) values ("localhost", "test", password ("1234 "));
3. Authorize the user: grant permission on database. * to username @ login host identified by "password ";
4. Refresh the system permission table: mysql> flush privileges;
Example 1:
mysql>grant select,update on testDB.* to test@localhost identified by '1234';mysql>flush privileges;
Example 2:
mysql>grant all privileges on *.* to test@localhost indentified by '1234';