Install the MySQL5.7.18 Binary Package in Linux (manually add the configuration file my_default.cnf) and mysqlmydefault. cnf
Source: http://www.cnblogs.com/wy123/p/6815049.html
I am new to MySQL, but I don't know much about Linux, Because I downloaded the latest MySQL (MySQL5.7.18) Binary Package and tested and installed it in CentOS7.2 to facilitate the future.
The steps are as follows. The installation and deletion process has been repeated several times. follow the steps below to avoid any problems.
It is not as complicated as you think. Most of the steps are based on the Internet. If something goes wrong, try more and check more information.
Operating system version
Create a mysql group and user
Download the latest MySQL 5.7.18 Binary Package and upload it to the usr/local directory of the server.
Decompress the MySQL Binary Package
The following is the file information after decompression and renaming the folder:
Change the group and user
Contents of the decompressed MySQL File
Check the support-files folder and find that there is no default configuration file my_default.cnf. If there is no default configuration file, you need to manually create a configuration file my_default.cnf
I found a configuration file from the Internet, as shown below, and uploaded it to the supp-files Folder. Of course, this configuration file can be modified as needed,
20170505 supplement: This step should be incorrect. If there is no default configuration file, it seems that it can also be started normally. I will try again later.
# For advice on how to change settings please see # http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html# *** do not edit this file. it's a template which will be copied to the # *** default location during install, and will be replaced if you # *** upgrade to a newer version of MySQL. [mysqld] SQL _mode = NO_ENGINE_SUBSTITUTION, STRICT_TRANS_TABLES # general configuration options: basedir =/usr/local/mysqldatadir =/usr/local/mysql/dataport = 3306 socket =/var/run/mysqld. sockcharacter-set-server = utf8back_log = 300max_connections = bytes = 50table_open_cache = bytes = 32 M # bytes = 16query_cache_size = bytes = 8thread_stack = bytes = REPEATABLE-READtmp_table_size = 128 M # log-bin = mysql-binlong_query_time = 6server_id = clerk = 90innodb_lock_wait_timeout = 120innodb_file_per_table = on [mysqldump] quickmax_allowed_packet = 32 M [mysql] no-auto-rehashdefault-character-set = utf8safe-updates [myisamchk] key_buffer = bytes = 16Mread_buffer = 8Mwrite_buffer = 8 M [mysqlhotcopy] interactive-timeout [mysqld_safe] open-files-limit = 8192 [client]/bin/bash: q: command not found
Upload the default configuration file to the support-files folder as follows:
Register and initialize the MySQL Service
This is a pitfall. Most of the online tutorials are installed in mysql_install_db mode. This step is also the most problematic and has been difficult for a long time. However, the mysql_install_db command is not recommended, you are also prompted to use mysqld for installation.
When installing mysql 5.7.18, there are also various errors. After a variety of attempts, use the following naming method for installation. As long as there is no Error, the Warning information Warning ignores it first.
Bin/mysqld -- initialize-insecure -- user = mysql -- basedir =/usr/local/mysql/-- datadir =/usr/local/mysql/data/
Copy the above my_default.cnf and mysql. server configuration files to the etc directory, and copy the file to the etc directory before. It prompts whether to overwrite the file. Enter Y to overwrite the file.
Start MySQL Service
Connect to MySQL. No password by default. Press enter to connect to MySQL.
Modify the root password of MySQL
Modify remote access
Restart MySQL Service
MySQL can be used locally
Test remote connection