Centos mysql installation and configuration

Install Mysql

  1. 1
    Installing Mysql under Centos 6.6 is very simple,
    yum list mysql-server

  1. 2
    When there is only one, it can be directly
    yum install mysql-server
    To install

  1. 3
    Select Y to continue the installation during the process, and finally the installation is successful

END

Set up Mysql service##

  1. 1
    Start the Mysql service first
    service mysqld start

  1. 2
    Connect it and try it directly
    mysql
    then
    \ q
    Close the connection

  1. 3
    Set Mysql to start at boot
    chkconfig mysqld on

  1. 4
    Open 3306 port and save
    /sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
    /etc/rc.d/init.d/iptables save

END

Change password and set remote access##

  1. 1
    Connect to mysql database
    set password
    use mysql;
    update user set password=password('password') where user='root';
    flush privileges;

  1. 2
    Set up Mysql remote access
    grant all privileges on . to 'root'@'%' identified by '123456' with grant option;

END

Solve the problem of Mysql garbled##

Find a configuration file, copy it to the /etc/ directory, and name it my.cnf
(Sometimes there is no my.cnf)
cp /usr/share/doc/mysql-server-5.1.73/my-medium.cnf /etc/my.cnf

vim my.cnf
Add under [client] and [mysqld]
default-character-set=utf8

  1. 3
    Finally press Esc to enter
    : wq
    Save and exit

END

Restart mysql service##

  1. 1
    Finally, restart the service.
    service mysqld restart

END

Precautions##

Recommended Posts

Centos mysql installation and configuration
Centos7 mysql database installation and configuration
Mysql8.0.15 installation configuration (centos7)
MySQL 8.0 installation, deployment and configuration under CentOS 6/7
Centos7 installation and configuration prometheus
CentOS 7 installation and configuration PPTP
CentOS installation and configuration cmake
Centos7.5 installation and configuration MongoDB4.0.4
CentOS 7 installation and configuration PPTP
MySQL 8.0 installation, deployment and configuration tutorial on CentOS 8
Centos MySQL8 configuration
Centos7 installation and configuration of Jenkins
Centos7 hadoop cluster installation and configuration
Java-JDK installation and configuration under CentOS
CentOS 7 Tomcat service installation and configuration
CentOS NTP server installation and configuration
CentOS 7 system installation and configuration graphic tutorial
Installation and use of Mysql under CentOS
Tomcat installation and configuration under CentOS 7 (Tomcat startup)
OpenMPI-Ubuntu installation and configuration
Installation and configuration of redis under centos7
Centos7 hive stand-alone mode installation and configuration
Installation and configuration of JDK in CentOS 7 system
CentOS 6.5 system installation and configuration graphic tutorial (detailed graphic)
CentOS 7 installation and configuration graphic tutorials under VMware10
Installation and configuration of rsync server under CentOS 6.5
Installation and configuration of CentOS 7 in VMware Workstation
MySQL 8.0 installation and deployment under CentOS, super detailed!
Ubuntu16.04 installation and simple configuration
CentOS 6.x installation mysql5.7 record
centos7 kvm installation and use
CentOS mysql configuration master-slave replication
CentOS7 postgresql installation and use
Ubuntu PostgreSQL installation and configuration
Centos7 elk7.1.1 installation and use
Environment configuration of JDK, mysql and tomcat under Centos7
2019-07-09 CentOS7 installation
centos7_1708 installation
CentOS7 yum install and start mysql
CentOS Yum compile and install MySQL 5.6
CentOS 8 install Git and basic configuration
Centos6.5 installation and deployment of KVM
CentOS7 installation and maintenance of Gitlab
CentOS7.2 and Nginx configuration virtual host
CentOS7 yum install and start mysql
Centos7 and centos8 install mysql5.6 5.7 8.0 so simple
CentOS 7.X system installation and optimization
Centos 7 RAID 5 detailed explanation and configuration
Ubuntu 19.1 installation and configuration Chinese environment
The latest Centos7 installation Mysql8 guide
Configuration and beautification after Ubuntu installation (1)
Nginx installation and configuration load (ubuntu12.04)
CentOs7 installation and deployment Zabbix3.4 original
Erlang 20.2 installation and deployment under CentOS 7
Ubuntu configuration source and installation software
[Switch] CentOS7 64-bit installation mysql tutorial
Detailed explanation of Spark installation and configuration tutorial under centOS7
Introduction to CentOS7 installation process of openjdk, tomcat and mysql
Centos5 installation guide
CentOS7.2 install Mysql5.7.13
CentOS7 install MySQL