installation
yum install -y mariadb mariadb-server
systemctl start mariadb
mysql -u root
set password = password ( 'password')
Setting permissions
use mysql
delete from user where password=''
update user set host = '%' # provided remote access
flush privileges;
If the remote access can not, check the firewall
View systemctl status firewalld
Stop and cancel at startup
systemctl disable firewalld
systemctl stop firewalld
Installed
Modify the database storage location
Three steps
1, arranged my.cnf position /etc/my.cnf
[mysqld]
DATADIR = / Vdata / mysql_data /
Socket = / Vdata / mysql_data / mysql.sock
the wait_timeout # = 2.88 million optimization
max_allowed_packet = 128M # optimization
interactive_time = 280000 # optimization
thread_concurrency = 20 # optimization
max_connections = 1500 # optimization
max_connect_errors = 30 # Optimization
table_open_cache = 1024 # optimization
myisam_sort_buffer_size = 32M # optimization
bulk_insert_buffer_size = 32M # optimization
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd
[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid
#
# include all files from the config directory
#
!includedir /etc/my.cnf.d
2, disposed server.cnf position /etc/my.cnf.d/server.cnf
[mysqld]
datadir=/vdata/mysql_data/
socket=/vdata/mysql_data/mysql.sock
3, configure client /etc/my.cnf.d/client.cnf
[mysqld]
socket=/vdata/mysql_data/mysql.sock
Configuration database to / vdata / mysql_data completed.
Restart mariadb
systemctl restart mariadb
If not start
Check the / etc / selinux / config, enforinng whether it is disable, if not changed to disable
chmod -R mysql: mysql / vdata / mysql_data # set permissions for the mysql database directory
After re-optimization