当前位置:网站首页>Linux Installation MySQL (pit filling version)
Linux Installation MySQL (pit filling version)
2022-07-28 20:21:00 【LifeBackwards】
Before installation , First check whether the system has been installed mysql:
rpm -qa | grep mysql |
If installed , You can choose to uninstall through the following command :
rpm -e mysql // Normal delete mode rpm -e --nodeps mysql // Strong delete mode , If you use the above command to delete , Prompt for other dependent files , It can be forcefully deleted with this command |
install Mysql
Tools :CentOS 7 64 position 、Mysql5.7
1 Download from the official website mysql Compiled binary installation package
choice 64 Bit system download Linux - Generic (glibc 2.5) (x86, 64-bit).

2 Unzip the installation package
Enter the directory where the installation package is located , Unzip the installation package :
tar -zxvf mysql-5.7.10-linux-glibc2.5-x86_64.tar.gz |
3 Copy the decompressed mysql Directory to the local software directory of the system
Be careful : Don't add /
mv mysql-5.7.10-linux-glibc2.5-x86_64 /usr/local/mysql |
4 Add system mysql Group and mysql user
Carry out orders :groupadd mysql and useradd -r -g mysql mysql
![]()
5 mount this database
5.1 Create a data directory and give permissions :
mkdir -p /data/mysql chown mysql:mysql -R /data/mysql |
5.2 To configure my.cnf:
vim /etc/my.cnf |
The contents are as follows :
[mysqld] bind-address=0.0.0.0 port=3306 user=mysql basedir=/usr/local/mysql datadir=/data/mysql socket=/tmp/mysql.sock log-error=/data/mysql/mysql.err pid-file=/data/mysql/mysql.pid #character config character_set_server=utf8mb4 symbolic-links=0 explicit_defaults_for_timestamp=true
|
5.3 Initialize database
Get into mysql Of bin Catalog :cd /usr/local/mysql/bin
initialization
./mysqld --defaults-file=/etc/my.cnf --basedir=/usr/local/mysql/ --datadir=/data/mysql/ --user=mysql --initialize |
5.4 Boot up mysql service
Put the startup script into the startup initialization directory :
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql |
Give executable permission :chmod +x /etc/init.d/mysql
Add as a service : chkconfig --add mysql
View the list of services : chkconfig --list mysql

notice 3、4、5 The status is on or on That means success . If it is Off or off Then execute :chkconfig --level 345 mysqld on
5.5 start-up
start-up mysql
service mysql start |
ps -ef|grep mysql notice mysql Service description started successfully , Pictured

So let's go over here mysql It has been installed successfully !
5.6 Change Password
The following changes mysql password , Log in first mysql, The initial password is empty , If you cannot log in successfully :
![]()
be , Stop service first :/etc/init.d/mysql stop
And then into mysql Install under directory bin Catalog , perform :
./mysqld_safe --user=mysql --skip-grant-tables --skip-networking & |
Log in again mysql -u root -p, You can log in . Here's the picture

Execute after entering :mysql> flush PRIVILEGES;
Reset password : mysql> alter user 'root'@'localhost' identified by '1234567';
perform mysql>fulsh tables; sign out . You can use the new password when logging in again .

5.7 mysql Allow remote access

First, turn off the server firewall .
Sign in mysql, see mysql In the library user Tabular host Field

Host Field ,localhost Indicates that only local access is allowed , To achieve a remote connection , Need to put root User host Change it to % To allow to be arbitrary host visit . Then use the command mysql> flush privileges; Make this amendment effective immediately .

Connect remotely again , success !

边栏推荐
- How can Plato obtain premium income through elephant swap in a bear market?
- Raspberry connects EC20 for PPP dialing
- Scene thread allocation in MMO real-time combat games
- Raspberry pie 4B parsing PWM
- Power Bi 2021 calendar DAX code
- Multi-Modal Knowledge Graph Construction and Application: A Survey
- [C language] simulation implementation of strlen (recursive and non recursive)
- Raspberrypico analytic PWM
- 8. Compilation errors of C language and Chinese explanation
- 9. Pointer of C language (4) pointer and one-dimensional array, pointer operation
猜你喜欢

Longest Palindromic Substring

JVM(二十四) -- 性能监控与调优(五) -- 分析GC日志

3、 Are formal and actual parameters in a programming language variables?

The cloud native programming challenge is hot, with 510000 bonus waiting for you to challenge!
![[C language] header file of complex number four operations and complex number operations](/img/f9/b389fe5367f1fa6cd18aaac856bc0d.png)
[C language] header file of complex number four operations and complex number operations

一碰撞就自燃,谁来关心电池安全?上汽通用有话说
![[C language] step jumping problem [recursion]](/img/0c/32870484e89b494e41068f7c38b08e.png)
[C language] step jumping problem [recursion]

Raspberrypico serial communication

Zfoo adds routes similar to mydog

A chip company fell in round B
随机推荐
[C language] Fibonacci sequence [recursion and iteration]
Raspberrypico analytic PWM
9. Pointer of C language (4) pointer and one-dimensional array, pointer operation
C language - data storage
C language data 3 (1)
Raspberry connects EC20 for PPP dialing
Theoretical knowledge of digital image (I) (personal analysis)
Using Lex (Flex) to generate lexical analyzer of PL language
What is the variance?
Does any elder brother know how to solve the huge flinksql log
Raspberry pie creation self start service
C language operators and input and output
产品经理访谈 | 第五代验证码的创新与背景
Implementation of strstr in C language
C language array and bubble sort
七种轮询介绍(后附实践链接)
Solve the cookie splitting problem (DP)
Token verification program index.php when configuring wechat official account server
Store and guarantee rancher data based on Minio objects
The results of the second quarter online moving people selection of "China Internet · moving 2022" were announced