当前位置:网站首页>Zhangxiaobai takes you to install MySQL 5.7 on Huawei cloud ECS server
Zhangxiaobai takes you to install MySQL 5.7 on Huawei cloud ECS server
2022-06-12 00:12:00 【Hua Weiyun】

Hua Wei Yun ECS Server after purchase , There will be a built-in similar MySQL The database of , be called mariadb.
In general , If you want to use MySQL, It is better to replace this database , The following is Zhang Xiaobai's replacement practice with reference to the introduction on the Internet .
Use root Sign in , see mariadb Version of :

Delete mariadb:

see MySQL Whether to install :

download MySQL5.7.37 Code package for :
cd /usr/local
wget https://cdn.mysql.com/Downloads/MySQL-5.7/mysql-5.7.37-el7-x86_64.tar.gz

decompression :
tar -zxvf mysql-*.gz
mv mysql-5.7.37-el7-x86_64 mysql

Set the permissions :
chown -R mysql:mysql /usr/local/mysql
chmod -R 755 /usr/local/mysql
mkdir -p /data/mysql/data
mkdir -p /data/mysql/logs
mkdir -p /data/mysql/tmp
chown -R mysql:mysql /data/mysql
edit /etc/my.cnf file :
[client]port = 3306socket = /data/mysql/tmp/mysql.sock[mysqld]user = mysqlbasedir = /usr/local/mysql datadir = /data/mysql/data port = 3306 socket = /data/mysql/tmp/mysql.sockpid-file = /data/mysql/tmp/mysqld.pidtmpdir = /data/mysql/tmp skip_name_resolve = 1symbolic-links=0max_connections = 2000group_concat_max_len = 1024000sql_mode = NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTIONlower_case_table_names = 1log_timestamps=SYSTEMcharacter-set-server = utf8interactive_timeout = 1800 wait_timeout = 1800max_allowed_packet = 32Mbinlog_cache_size = 4Msort_buffer_size = 2Mread_buffer_size = 4Mjoin_buffer_size = 4Mtmp_table_size = 96Mmax_heap_table_size = 96Mmax_length_for_sort_data = 8096#logsserver-id = 1003306log-error = /data/mysql/logs/error.logslow_query_log = 1slow_query_log_file = /data/mysql/logs/slow.loglong_query_time = 3log-bin = /data/mysql/logs/binlogbinlog_format = rowexpire_logs_days = 15log_bin_trust_function_creators = 1relay-log = /data/mysql/logs/relay-binrelay-log-recovery = 1 relay_log_purge = 1 #innodb innodb_file_per_table = 1innodb_log_buffer_size = 16Minnodb_log_file_size = 256Minnodb_log_files_in_group = 2innodb_io_capacity = 2000innodb_io_capacity_max = 4000innodb_flush_neighbors = 0innodb_flush_method = O_DIRECTinnodb_autoinc_lock_mode = 2innodb_read_io_threads = 8innodb_write_io_threads = 8innodb_buffer_pool_size = 2Gtake mysql Set to linux service :
cd /usr/local/mysql/support-files
cp mysql.server /etc/init.d/mysql
edit /etc/init.d/mysql file :
Set the following two lines :
basedir=/usr/local/mysql
datadir=/data/mysql/data
chkconfig --add mysql
chkconfig --list

Edit environment variables :
echo "PATH=$PATH:/usr/local/mysql/bin " >> /etc/profile
source /etc/profile

Manual start MySQL:

Report errors !
Need to install libaio software package :
rpm -qa|grep libaio
yum install libaio-devel.x86_64

Start again MySQL Try :

The string of characters indicated by the arrow above is temporary root password .
restart MySQL:
service stop mysql
service start mysql
Sign in MySQL Command line :
mysql -uroot -p
Enter the previous temporary password to enter the command line .
modify root password :
alter user 'root'@'localhost' identified by 'xxxxxx';
flush privileges;

quit Exit the command line .
ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql
You can restart again MySQL:
service restart mysql

After that, you can use the new password to log in at the command line .
If you want to use remote login , The following needs to be modified :
grant all privileges on *.* to'root'@'%' identify by 'xxxxxx' with grant option;
flush privileges;
Restart again MySQL that will do .
( The full text after , Thank you for reading )
边栏推荐
- What is webstorage? And cookies
- (greedy + longest ascending subsequence) acwing 896 Longest ascending subsequence II
- Summary of DOM knowledge points
- m-way search trees
- Experiment 7 class construction and static member function
- Beginner JS BOM implementation window centered
- 【juc学习之路第7天】ReentrantLock与ReentrantReadWriteLock
- Concevoir une table MySQL pour la mise en file d'attente des messages pour stocker les données des messages
- DPT-FSNET: DUAL-PATH TRANSFORMER BASED FULL-BAND AND SUB-BAND FUSION NETWORK FOR SPEECH ENHANCEMENT
- 将数组分成和相等的三个部分[问题分析]
猜你喜欢

时间选择器样式错乱 中间文字被遮挡
![[flume] notes](/img/33/50f14b0267c5e502970cee0278aa71.jpg)
[flume] notes

苹果手机wps文件如何发送到qq邮箱

voc数据格式转为coco数据格式
![[JUC series] overview of executor framework](/img/e3/5131dcdd255c1571e64ae1f0459113.png)
[JUC series] overview of executor framework

Mingdeyang ADC series development board-ad9653 daughter board multi-channel high resolution and high sampling rate
![[signals and systems] (XXII) Laplace transform and complex frequency domain analysis - s-domain analysis](/img/35/a23646ac8501ac646cd44eeecd5b79.jpg)
[signals and systems] (XXII) Laplace transform and complex frequency domain analysis - s-domain analysis

Flex flexible layout tutorial and understanding of the main axis cross axis: Grammar

How many steps does it take for C language to become Fibonacci number

干货|一次完整的性能测试,测试人员需要做什么?
随机推荐
UVM: transaction level modeling (TLM) 1.0 communication standard
11. conditional statement if, switch
[signals and systems] (XXII) Laplace transform and complex frequency domain analysis - s-domain analysis
(counting class +dp) acwing 900 Integer partition
(dp) acwing 899. Edit distance
Design principle [Demeter's Law]
Collation of common array functions
No permission to mount SMB share prompt directory
Divide the array into three equal parts [problem analysis]
The road of global evolution of vivo global mall -- multilingual solution
oracle使用Navicat工具导入导出数据
Redis master-slave replication, sentinel mode and cluster
(dp+ longest common subsequence) acwing 897 Longest common subsequence
APP项目怎么测?如何搭建测试体系
Flex flexible layout tutorial and understanding of the main axis cross axis: Grammar
通过财报读懂企业的23个步骤
C language exercise: esp32 ble Low Power Bluetooth server data packaging and client data analysis
(digital statistics dp+good) acwing 338 Counting problem
明德扬ADC系列开发板-Ad9653子板 多通道 高分辨率 高采样率
多路查找树