MySQL version problems and multi-instance installation

1. Version issues

MySQL versions before 5.6.5 do not support multiple DEFAULT CURRENT_TIMESTAMP and ON UPDATE CURRENT TIMESTAMP


Note that since MySQL 5.6.5, the DATETIME data type also has automatic initialization and automatic update feature. In addition, the DEFAULT_CURRENT_TIMESTAMP and ON UPDATE CURRENT TIMESTAMP attributes can be applied to multiple columns, not just 1 column in the previous versions.
That is, for MySQL versions before 5.6.5, multiple simultaneous use of DEFAULT CURRENT_TIMESTAMP and ON UPDATE CURRENT TIMESTAMP attributes is not supported. Use mysql -v to check The MySQL version I am using now is 5.5.49, that is, it does not support multiple simultaneous use. So update mysql to 5.6.31 and the problem is solved.

 



2. Unzip the multi-instance installation and place it on the local disk. It was found that the file is very large, about 1.6G. Delete the .lib files in the lib folder and all files in the debug folder.
Create the my.ini file in the main directory, the content of the file is as follows: (here is the concise version, modify the directory of basedir and datadir corresponding to the local machine, you can expand the configuration according to your needs)
[client]
port=13306
default-character-set=utf8
[mysqld]
basedir=D:\mysql-5.7.22-winx64
datadir=D:\mysql-5.7.22-winx64\data
port=13306
character-set-server=utf8
character-set-filesystem = utf8
sql_mode=NO_ENGINE_SUBSTITUTION, NO_AUTO_CREATE_USER
explicit_defaults_for_timestamp=true
skip-grant-tables

has no data files, you need to create a data folder yourself. Here start to pay attention to the command sequence
D:\mysql-5.7.22-winx64\bin>./mysqld.exe --initialize-insecure

mysql service install.
D:\mysql-5.7.22-winx64\bin>./mysqld.exe -install MySQL57

start mysql
net start MySQL57

is very important: set the password of the root user, the above is a passwordless login to
delete skip-grant-tables in my.ini; restart MySQL57.
Enter the mysql environment, mysql -u root
to change the password, alter user root@localhost identified by "123456"

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325974800&siteId=291194637