This article records the installation and configuration graphic tutorial of Linux MySQL 8.0.18 for your reference. The specific contents are as follows 1. Official website installation package download address 2. I upload the installation package to the Linux server via xftp 3. Unzip Decompression command: tar -xvf mysql-8.0.18-linux-glibc2.12-x86_64.tar Continue to unzip the one you need Command: tar -xvf mysql-8.0.18-linux-glibc2.12-x86_64.tar.xz Rename and move to the appropriate directory Rename: mv mysql-8.0.18-linux-glibc2.12-x86_64 mysql move: 4. Create a data folder under /usr/local/mysql # mkdir data 5. Initialize the database and automatically generate a password that needs to be recorded for later use # bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data ps: I encountered a pit in the middle and reported an error when initializing the database The specific error is: bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory The solution is: yum install libaio-devel.x86_64 The reason is that libaio is missing. Just install it. Execute the initialization command again Get the initialization password, you need to write it down, you will need it later 6. Modify the user of the current directory /usr/local/mysql # chown -R root:root ./ # chown -R mysql:mysql data 7. Copy the my-default.cnf file to etc/my.cnf The specific commands are: # cd support-files/ # touch my-default.cnf # chmod 777 ./my-default.cnf # cd ../ # cp support-files/my-default.cnf /etc/my.cnf 8. After finishing, configure my.cnf vim /etc/my.cnf content: [mysqld] # Remove leading # and set to the amount of RAM for the most important data # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%. # innodb_buffer_pool_size = 128M # Remove leading # to turn on a very important data integrity option: logging # changes to the binary log between backups. # log_bin # These are commonly set, remove the # and set as required. basedir = /usr/local/mysql datadir = /usr/local/mysql/data socket = /tmp/mysql.sock log-error = /usr/local/mysql/data/error.log pid-file = /usr/local/mysql/data/mysql.pid tmpdir = /tmp port = 5186 #lower_case_table_names = 1 # server_id = ..... # socket = ..... #lower_case_table_names = 1 max_allowed_packet=32M default-authentication-plugin = mysql_native_password #lower_case_file_system = on #lower_case_table_names = 1 log_bin_trust_function_creators = ON # Remove leading # to set options mainly useful for reporting servers. # The server defaults are faster for transactions and fast SELECTs. # Adjust sizes as needed, experiment to find the optimal values. # join_buffer_size = 128M # sort_buffer_size = 2M # read_rnd_buffer_size = 2M sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES If MySQL reports an error during operation, you can directly view the error log in the log-error = /usr/local/mysql/data/error.log directory Command: cat /usr/local/mysql/data/error.log 9. Start automatically and enter /usr/local/mysql/support-files for settings # cd support-files/ # cp mysql.server /etc/init.d/mysql # chmod +x /etc/init.d/mysql 10. Registration Services # chkconfig --add mysql 11. Check if it is successful 12.etc/ld.so.conf needs to configure the path, otherwise an error will be reported # vim /etc/ld.so.conf Add the following content: /usr/local/mysql/lib 13. Configure environment variables # vim /etc/profile # source /etc/profile Add the following content: #MYSQL ENVIRONMENT export PATH=$PATH:/usr/local/mysql/bin:/usr/local/mysql/lib 14. Login requires the password generated above #Start mysql service [root@localhost bin]# service mysql start Starting MySQL.Logging to '/usr/local/mysql/data/error.log'. ..SUCCESS! [root@localhost bin]# #Change mysql passwordmysql> alter user 'root'@'localhost' identified by '123456'; Query OK, 0 rows affected (0.02 sec) mysql> ps: The second pit, the error details appear at startup: I spent the whole afternoon looking for this error and finally found out that the problem was with the my.cnf file configuration. Don't assume that adding # means it is commented out. I checked it n times and felt that there was nothing wrong, but it just didn't work. I had no choice but to find a my.cnf configuration from another server, copied it, replaced it with a slight modification, and solved the problem. Mission accomplished! You can now use the visual tool to connect to the database. The installation is complete. Wonderful topic sharing: MySQL different versions installation tutorial MySQL 5.7 installation tutorials for various versions MySQL 5.6 installation tutorials for various versions mysql8.0 installation tutorials for various versions The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: How to express relative paths in Linux
>>: JavaScript ECharts Usage Explanation
Today I made a menu button. When you move the mous...
The questions encountered in Baidu interviews nee...
There is no need to say much about the difference...
Table of contents npm Install the loader Import P...
Basic Use <!DOCTYPE html> <html lang=&qu...
Table of contents 1. Some concepts you need to un...
1. Block-level element: refers to the ability to e...
Six steps of JDBC: 1. Register the driver 2. Get ...
There are three ways to create an image: creating...
Table of contents Container Hierarchy The process...
Copy code The code is as follows: <iframe id=&...
html,address, blockquote, body,dd,div, dl,dt,fiel...
Label display mode (important) div and span tags ...
If there is a backup, it is very simple. You only...
The final result is like this, isn’t it cute… PS:...