Unified character encoding and creation user authorization

1./s; (all commands add a semicolon, different from Sqlserver, Oracle),

  Check the current configuration of Mysql

Share pictures

To unify character encoding , Please perform the following operations:

(1) my.ini file is the configuration file of mysql,

in C:\mysql-5.6.40 -Create a my.ini file under the winx64 file (installation path)

(2) Copy and save the following code.

copy code

[mysqld]
# Set the mysql installation directory ** The path behind must be the directory where SQL is installed (on your own computer)**
basedir=C:\mysql-5.7.22-winx64\mysql-5.7.22-winx64
# Set the storage directory of mysql database data, which must be data
datadir=C:\mysql-5.7.22 -winx64\mysql-5.7.22-winx64\data
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

# mysql port
port=3306
# Character set
[mysqld]
character-set-server=utf8
collation-server=utf8_general_ci
[client]
default-character-set=utf8
[mysql]
default-character-set=utf8

copy code

(3) Restart the service as an administrator and execute the following command

copy code

C:\Windows\system32>net stop MySQL

The MySQL service is stopping..
The MySQL service has been successfully stopped.

C:\Windows\system32>net start MySQL
The MySQL service is starting.
The MySQL service has been started successfully.
copy code< /span>

(4) Enter mysql in cmd to enter the mysql environment, execute \s, and display the following information, which means success

share picture

Under the C:\mysql-5.6.40-winx64 file ( Installation path) Create my.ini file

copy code

[mysqld]
# Set the mysql installation directory ** The path behind must be the directory where SQL is installed (own Computer) **
basedir=C:\mysql-5.7.22-winx64\mysql-5.7.22-winx64
# Set the storage directory of mysql database data, it must be data
datadir=C :\mysql-5.7.22-winx64\mysql-5.7.22-winx64\data
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

# mysql port
port=3306
# Character set< br>[mysqld]
character-set-server=utf8
collation-server=utf8_general_ci
[client]
default-character-set=utf8
[mysql]
default- character-set=utf8

copy code

copy code

copy code

copy code
C:\Windows\system32>net stop MySQL

The MySQL service is stopping..
The MySQL service has been successfully stopped.

C:\Windows\system32>net start MySQL
The MySQL service is starting.
The MySQL service has been started successfully.
copy code< /span>

copy code

copy code< /span>

Leave a Comment

Your email address will not be published.