System Environment: CentOS 7
MARIADB version: Mariadb 10.0.14
Download Address: http://mirrors.neusoft.edu.cn/mariadb/mariadb-10.0.14/source/mariadb-10.0.14.tar.gz
Other Package Address: https://downloads.mariadb.org/
Add a MySQL User
Useradd MySQL
Start Compiling installation mariadb
wget http://mirrors.neusoft.edu.cn/mariadb/cmariadb-10.0.14/source/mariadb-10.0.14.tar.gz
Tar zxvf mariadb-10.0.14.tar.gz
CD mariadb-10.0.14
CMake.
Make
Make install
Chown-r mysql/usr/local/mysql/
scripts/mysql_install_db--user=mysql
/usr/local/mysql/bin/mysqld_safe--user=mysql &
Start if error, it should be mariadb startup to create some log files by default, or run related files, but did not create, or the specified directory does not exist
This is usually because:
I. Creating Mariadb.log files in/var/log/mariadb/does not have permissions
Two. There is no permission to create Mariadb.pid in/VAR/RUN/MARIADB.
So we're going to create two separate directories.
Mkdir/var/log/mariadb
Mkdir/var/run/mariadb
Chown mysql-r/var/run/mariadb #所有权给mysql用户, you cannot create/var/run/mariadb/mariadb.pid files
Of course, the above configuration can be modified, MY.CNF configuration file to modify its location
To modify the root user password:
/usr/local/mysql/bin/mysqladmin-u root password ' 123456 '
Other problems that may be encountered
1. mysql client cannot start
Modify/ETC/MY.CNF
[MySQL]
Socket=/var/lib/mysql/mysql.sock
2. ERROR 2002 (HY000): Can ' t connect to the local MySQL server through socket '/tmp/mysql.sock ' (2)
This error is due to the socket position, add a soft chain, of course, modify the/etc/my.cnf sock location can also
Ln-s/var/lib/mysql/mysql.sock/tmp/mysql.sock