1./s; (all commands add a semicolon, different from Sqlserver, Oracle),
Check the current configuration of Mysql
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.
[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
(3) Restart the service as an administrator and execute the following command
(4) Enter mysql in cmd to enter the mysql environment, execute \s, and display the following information, which means success
Under the C:\mysql-5.6.40-winx64 file ( Installation path) Create my.ini file
[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
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.
< /span>