当前位置:网站首页>Centos7 deploying mysql-5.7
Centos7 deploying mysql-5.7
2022-06-24 06:33:00 【User 1348170】
One . Environmental statement
[mysql-Server] Host name = host-1 System = centos-7.3 Address = 1.1.1.1 Software = mysql-5.7 3306
Using binary package deployment will result in large downloads , about 500M about , There are dozens of source code packages M. But using binary packages does not require compilation , Faster deployment , Compared with yum You can customize the directory , Convenient maintenance .
Two . Program deployment
1. Installation dependency yum -y install autoconf libaio bison ncurses-devel
2. Create user groupadd mysqluseradd -g mysql -s /sbin/nologin mysql
3. clear centos7 The default built-in database , Be sure to clean it up yum -y remove mariadb mariadb-server
4. Download binary package wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.21-linux-glibc2.12-x86_64.tar.gztar -xf mysql-5.7.21-linux-glibc2.12-x86_64.tar.gz
Move past , Next is the storage path mv mysql-5.7.21-linux-glibc2.12-x86_64 /usr/local/mysqlmkdir /var/log/mysqlmkdir /usr/local/mysql/data
mysql Even if root Start or mysql user-run , So give permission chown -R mysql:mysql /usr/local/mysqlchown -R mysql:mysql /var/log/mysql
5. Go in and delete all rows , Add new vim /etc/my.cnf
[client]port = 3306socket = /tmp/mysql.sock[mysqld]character_set_server=utf8init_connect='SET NAMES utf8'basedir=/usr/local/mysqldatadir=/usr/local/mysql/datasocket=/tmp/mysql.socklog-error=/var/log/mysqld.logpid-file=/usr/local/mysql/mysqld.pid
6. initialization cd /usr/local/mysql/bin
Initialize database , No response is correct , Here you can customize the directory /usr/local/mysql/bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --lc_messages_dir=/usr/local/mysql/share --lc_messages=en_US
7. Join in systemctl control vim /usr/lib/systemd/system/mysql.service
[Unit]Description=mysqlAfter=network.target remote-fs.target nss-lookup.target[Service]Type=forkingExecStart=/usr/local/mysql/support-files/mysql.server startExecReload=/usr/local/mysql/support-files/mysql.server restartExecStop=/usr/local/mysql/support-files/mysql.server stopPrivateTmp=true[Install]WantedBy=multi-user.target
8. Set the environment variable echo 'PATH=$PATH':/usr/local/mysql/bin >> /etc/profilesource /etc/profile
9. start-up systemctl daemon-reloadsystemctl start mysqlsystemctl enable mysql
3、 ... and . Change initial password 1. Check the password cat /var/log/mysqld.log The last line :[email protected]: Here is the initial password
You need to enter the database and change the password with the following command to make the database work normally mysql -uroot -pALTER USER USER() IDENTIFIED BY '123456';
边栏推荐
- Network review
- The installation method of apache+mysql+php running environment under Windows
- Micro build low code supports Excel to import data source
- Linux Apache setting compression and caching
- Risk management - Asset Discovery series - public web asset discovery
- Kangaroo cloud: the overall architecture and key technical points of building a real-time computing platform based on Flink
- Coding platform project construction guide
- How to check whether the domain name is filed? Must the domain name be filed for use?
- Intranet environment request Tencent cloud 3.0 API details
- Web automated testing (2): choose selenium advantage? Comparison with phantomjs/qtp/monkey
猜你喜欢

解读AI机器人产业发展的顶层设计

创客教育给教师发展带来的挑战

A cigarette of time to talk with you about how novices transform from functional testing to advanced automated testing
Fault analysis | using --force to batch import data leads to partial data loss

Enter the software test pit!!! Software testing tools commonly used by software testers software recommendations
Oracle case: ohasd crash on AIX

The product layout is strengthened, the transformation of digital intelligence is accelerated, and FAW Toyota has hit 2022million annual sales
![[fault announcement] one stored procedure brings down the entire database](/img/7c/e5adda73a077fe4b8f04b59d1e0e1e.jpg)
[fault announcement] one stored procedure brings down the entire database

Manual for automatic testing and learning of anti stepping pits, one for each tester

ServiceStack. Source code analysis of redis (connection and connection pool)
随机推荐
Enter the software test pit!!! Software testing tools commonly used by software testers software recommendations
Multi objective Optimization Practice Based on esmm model -- shopping mall
Kangaroo cloud: the overall architecture and key technical points of building a real-time computing platform based on Flink
Printer connection mode
创客教育给教师发展带来的挑战
CLB unable to access / access timeout troubleshooting
text classification with RNN
Easyscreen live streaming component pushes RTSP streams to easydarwin for operation process sharing
EEG microstate as a continuous phenomenon
Network Overview
[fault announcement] one stored procedure brings down the entire database
What is an enterprise mailbox domain name? How to register an enterprise mailbox domain name
How does easyplayer RTSP configure sending heartbeat information to the server?
MySQL forgets root password cracking root password cracking all user passwords, shell script
WordPress applet build applet from zero to one [server configuration]
The difference between ArrayList and LinkedList and the principle of using scene locality
Double non students, self-taught programming, counter attack Baidu one year after graduation!
Just now, we received a letter of thanks from Bohai University.
Interpreting the new features of Appstore: Customizing product pages and a/b test tools
How to select cloud game platforms? Just pay attention to two points