:
Http://mirrors.ustc.edu.cn/mariadb/mariadb-10.0.19/source/mariadb-10.0.19.tar.gz
because with cmake, This line can be installed .
Yum Install CMake
downloaded the tar.gz file to the specified directory tar-zxvf XXX.tar.gz
Go to the installation directory
[Email protected]]$ pwd
/app/mysql/mariadb-10.0.19
Create the following user groups, directories to install, and database directories
[[Email protected]]$ sudo groupadd mysql
[sudo] password FORHCR:
[[Email protected]]$ sudo useradd-g mysql mysql-s/bin/false
[Email protected]]$ mkdir-p/app/data/mysql
[Email protected]]$ sudo chown-r mysql:mysql/app/data/mysql/
[[Email protected]]$ mkdir/app/local/mysql
CMake. -dcmake_install_prefix=/app/local/mysql-dmysql_datadir=/app/data/mysql/-dsysconfdir=/etc
here may encounter the lack of ncurses (reported curseslibrary not found exception ) problem, can be installed,
Yum Installncurses-devel or now rpm Specifies the installation
[[Email protected]]$ make
Here is a little slow , I went to the pit daddy, too long time to wait, I know should choose
[[Email protected]]$ make install
a bunch of installing.
[[Email protected]]$ cd/app/local/mysql/
[Email protected]]$ sudo cp support-files/my-huge.cnf/etc/my.cnf
[[Email protected]]$ sudo vi/etc/my.cnf// edit config file , in [mysqld] section add datadir=/app/data/mysql// Add MariaDB Database Path
DataDir =/app/data/mysql
[Email protected]]$ sudo cp support-files/my-huge.cnf/etc/my.cnf
[Email protected]]$ sudo cp./support-files/mysql.server/etc/rc.d/init.d/mysqld
[Email protected]tmysql]$ sudo chmod 755/etc/init.d/mysqld
[[Email protected]]$ sudo chkconfig mysqld on
[Email protected]]$ sudo vi/etc/rc.d/init.d/mysqld
This place is by default
Basedir=
Datadir=
Change into
Basedir =/app/local/mysql #MariaDB program installation path
datadir=/app/data/mysql #MariaDB Database storage directory
service startup
[[Email protected]]$ sudo service mysqld start
Starting mysql.success!
Configuring into the environment
[[Email protected]]$ sudo vi/etc/profile// added an environment variable
Exportpath= $PATH:/app/local/mysql/bin
Get the machine back up here.
[Email protected]]$ sudo shutdown-r now
Initialize the mysqlroot password
[[Email protected] ~] #mysql_secure_installation
Note:running Allparts of this SCRIPT are RECOMMENDED for all MariaDB
SERVERS inproduction use! Please READ each STEP carefully!
In order to log intomariadb to secure it, we'll need the current
Password for theroot user. If you ' ve just installed MariaDB, and
You haven ' t set theroot password yet, the password would be blank,
So, should justpress enter here.
Enter CurrentPassword for root (enter for none):
ERROR 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using Password:yes)
Enter CurrentPassword for root (enter for none):
ERROR 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using Password:yes)
Initialize Direct enter just fine.
Enter CurrentPassword for root (enter for none):
OK, successfullyused password, moving on ...
Setting The Rootpassword ensures that nobody can logs into the MariaDB
Root user withoutthe proper authorisation.
Set root Password? [y/n] Y
New Password:
Re-enter NewPassword:
Password updatedsuccessfully!
Reloading Privilegetables.
... success!
By default, AMARIADB installation have an anonymous user, allowing anyone
To log into mariadbwithout has to has a user account created for
them. This isintended-testing, and to make the installation
Go a bit smoother. You should remove them before moving into a
Productionenvironment.
Remove anonymoususers? [y/n] Y
... success!
Normally, rootshould only is allowed to connect from ' localhost '. This
Ensures that someonecannot guess at the root of password from the network.
Disallow root loginremotely? [y/n] Y
... success!
By default, mariadbcomes with a database named ' test ' that anyone can
Access. This isalso intended only for testing, and should is removed
Before moving into aproduction environment.
Remove test Databaseand access to it? [y/n] n
... skipping.
Reloading Theprivilege tables would ensure that all changes made so far
would take effectimmediately.
Reload privilegetables now? [y/n] Y
... success!
Cleaning up ...
All done! If you ' vecompleted all of the above steps, your MariaDB
Installation Shouldnow be secure.
Thanks for usingmariadb!
[Email protected] ~]#
[[Email protected] ~] #service mysqld Restart
Shutting downmysql. success!
Starting mysql.success!
[Email protected]~]# mysql-u root-p
Enter Password:
Welcome to THEMARIADB Monitor. Commands End With; or \g.
Your mariadbconnection ID is 5
Server Version:10.0.19-mariadb-log Source Distribution
Copyright (c) 2000,2015, Oracle, MariaDB Corporation Ab and others.
Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.
MariaDB [(none)]>show tables
;
ERROR 1046 (3d000): No Database selected
MariaDB [(none)]>show databases;
+--------------------+
| Database |
+--------------------+
| information_schema|
| MySQL |
| performance_schema|
| Test |
+--------------------+
4 rows in Set (0.04SEC)
MariaDB [(None)]>// Create a test base connection
MariaDB [(None)]>create database r_test;
Query OK, 1 rowaffected (0.01 sec)
MariaDB [(None)]>grant all privileges on r_test.* to ' r_test ' @ ' localhost ' identifiedby ' r_test ';
Query OK, 0 rowsaffected (0.00 sec)
MariaDB [(None)]>grant all privileges on r_test.* to ' r_test ' @ '% ' identified by ' r_test ';
Query OK, 0 rowsaffected (0.00 sec)
Connect with navicat
Installation method Read reference:
Http://www.linuxidc.com/Linux/2014-11/109049.htm
CENTOS7 installation mariadb-10