当前位置:网站首页>MySQL installation
MySQL installation
2022-06-12 09:12:00 【A real rookie】
List of articles
Installation package download address : https://downloads.mysql.com/archives/community/

Check to see if there are already installed MySQL
Check whether the system is installed mysql:
rpm -qa | grep mysql
If so, force uninstall :
rpm -e --nodeps $(rpm -qa | grep mysql)
Or use
find / -name mysql
# perhaps whereis mysql Inquire about MySQL Related documents
# Use after discovery rm -rf Delete
MySQL install
Upload to the server and extract the file , Must be MySQL Transferred to /usr/local/mysql/ Under the table of contents , Otherwise start will report an error
tar -xvf mysql-5.7.37-linux-glibc2.12-x86_64.tar.gz
mv mysql-5.7.37-linux-glibc2.12-x86_64/* /usr/local/mysql/ # modify MySQL Catalog , If /usr/local/mysql/ New if it doesn't exist
Build users and groups
groupadd mysql
useradd -r -g mysql -s /bin/false mysql
Create related directories
mkdir -p /data/mysql
chown -R mysql:mysql /data # to MySQL Authorize this directory permission
chown -R mysql:mysql /usr/local/mysql/
chmod 755 /data
``
## Configure environment variables
To configure root User environment variable
```sql
cat <<EOF>> /root/.bash_profile # <<EOF>> Identification input EOF End editing
Enter... In the editable state of the file
> export PATH=\$PATH:/usr/local/mysql/bin
> EOF
Effective environment variables
source /root/.bash_profile
Compile and initialize
./mysqld --initialize --user=mysql --datadir=/data/mysql --basedir=/usr/local/mysql
Copy the password after execution 
To configure my.cnf
stay MySQL Catalog cd /soft/mysql-5.7.37 establish my.cnf
[mysqld]
user=mysql
datadir=/data/mysql
basedir=/usr/local/mysql
pid-file=/data/mysql/mysql.pid
port = 3306
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
symbolic-links=0
max_connections=400
innodb_file_per_table=1
lower_case_table_names=1
character_set_server=utf8mb4
socket=/data/mysql/mysql.sock
[mysqld] It can't be less , This is the file header
socket and pid-file It is best to assign and give mysql The user gives authority
Start the service
/usr/local/mysql/support-files/mysql.server start

This indicates that the startup was successful
add to mysql Soft connect and restart mysql service
ln -s /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql
ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql
service mysql restart
Change Password
Sign in
mysql -u root -p # Enter the password after prompting for it
set password for root@localhost = password('123456'); # 123456 For the modified password
Modify any ip All accessible
use mysql;
update user set user.Host='%' where user.User='root';
flush privileges;
Problems encountered during installation
- At first I didn't put MySQL The installation directory is set to
/usr/local/mysqlInitiate error reporting - No settings pid File startup error
- There was no... When I logged in mysql.sock File error
- And the startup times ignores
my.cnf file , as a result of my.cnf Permission is 777, Need to change to 655 Will not be ignored
After creating files for the above categories , And then to mysql User authorization is sufficient , adopt chown -R mysql:mysql File path
chmod 755 File path
边栏推荐
- (十三)文本渲染Text
- Counting haybales (difference + discretization)
- 机器学习笔记 - 循环神经网络备忘清单
- ISCSI详解(五)——ISCSI客户端配置实战
- EIP-1559
- Set up redis sentinel cluster (instance):
- Diff prime pairs
- (JS) three digits are separated by commas, and two decimal places are reserved (or rounded)
- Chapter 8 - two basic problems of data processing
- Introduction Fibonacci series
猜你喜欢

Node sample background setup

Redis installation test

After receiving the picture, caigou was very happy and played with PDF. The submission format was flag{xxx}, and the decryption characters should be in lowercase
自动化测试框架的设计原则有哪些?我帮你总结好了快来看

Construction of memcached cache service under Linux:

清华大学数据挖掘笔记(一)
测试用例和bug描述规范参考
![[character set 8] char8_ t、char16_ t、char32_ t、wchar、char](/img/ef/e57fb345b36c84d3585fca0568b0ee.png)
[character set 8] char8_ t、char16_ t、char32_ t、wchar、char

Black screen solution for computer boot

torch. logical_ And() method
随机推荐
更改tabledata列名
自动化测试框架的设计原则有哪些?我帮你总结好了快来看
Flink传入自定义的参数或配置文件
MFS explanation (IV) -- MFS management server installation and configuration
After receiving the picture, caigou was very happy and played with PDF. The submission format was flag{xxx}, and the decryption characters should be in lowercase
Complete knapsack problem 1
数据库常见面试题都给你准备好了
(node:22344) [DEP0123] DeprecationWarning: Setting the TLS ServerName to an IP address is not permit
On absolute value function in C language
Tool classes for extracting zip files
mySql学习记录——三、mysql查询语句
ABC253F Operations on a Matrix
测试用例和bug描述规范参考
Quick sort
測試用例和bug描述規範參考
Codecraft-22 and codeforces round 795 (Div. 2)
(14) Inputfield logic analysis
机器学习笔记 - 循环神经网络备忘清单
Jenkins pipeline syntax
Solve the problem that when unity is opened, you will be prompted that the project has been opened, but you have not opened it before (it may be closed abnormally before)