centos7.3 binary Mount mariadb-10.2.8-linux-x86_64
1. See if MARIADB is installed
Rpm-qa mariadb*
Uninstall if it is already installed.
2. Download the latest version of MARIADB
Yum Info mariadb
Website address: http://mariadb.org
Download: mariadb-10.2.8-linux-x86_64.tar.gz
3. Create a MySQL user
The RPM installation automatically creates a MySQL user, which needs to be created manually
useradd-d/app/mysqldb-r-m-s/sbin/nologin MySQL
-D set home directory; home directory for storing databases
-R Create System user
-M self-change permissions
-S Set Login mode
4, any directory import files, the experiment in/root
RZ import File
Unzip the tar xvf mariadb-10.2.8-linux-x86_64.tar.gz-c /usr/local/
Unzip to the fixed directory. This is already written fixed in the config file.
5, cd/usr/local/
The extracted folder name must be MySQL, (1) can rename (2) can create a soft connection
ln-s mariadb-10.2.8-linux-x86_64/mysql Creating a soft connection
6. Copying data files
Copy the data file to the specified directory
cd/usr/local/mysql/
mkdir/etc/mysql/
CP support-files/my-huge.cnf/etc/mysql/my.cnf (must be this name)
7. Modify the configuration file
Vim/etc/mysql/my.cnf
Add these three strips
[Mysqld]
datadir =/app/mysqldb #数据库存放位置
innodb_file_per_table = on #一张表一个数据库
skip_name_resolve = on #开启跳过名字解析
8. Create a Database
Cd/usr/local/mysql
Commands can only be executed in this directory, because they are already written fixed when the file is compiled.
scripts/mysql_install_db--user=mysql--datadir=/app/mysqldb Execute script, create DATABASE, specify user mysql, specify database directory /app/mysqldb
LS/APP/MYSQLDB Generating Data
9, copy the script, start the service.
CP Support-files/mysql.server/etc/init.d/mysqld
Chkconfig--add mysqld Add the service
Chkconfig--list mysqld See if Add success
Service Mysqld Start Services failed
10. Create a log file
mkdir/var/log/mariadb/
Chown mysql/var/log/mariadb/Modify Permissions
Service Mysqld Start Services successful
11. Easy to use command: Modify path Path
vim/etc/profile.d/tesh.sh
Path=/usr/local/mysql/bin: $PATH
Execute the file source /etc/profile.d/tesh.sh
to see if the modification was successful at the command line
Echo $PATH
/usr/local/mysql/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
12, because the MySQL database by default anonymous login, and login without password, execute a security script
/usr/local/mysql/bin/mysql_secure_installation
Because the path of the file is already set by the previous path variable, execute the script directly at the command line
mysql_secure_installation
Enter password for root (enter for none): (Enter the current root password, BAA direct return)
Set root Password? [y/n] y whether to set the root password, select Y
New Password:
Re-enter new password: Enter password two times
Remove anonymous users? [y/n] y Remove anonymous login, select Y
Disallow Root login remotely? [y/n] n allows root telnet, select N, which allows root telnet
Remove test database and access to it? [y/n] Y whether to remove the test database, the database is empty, meaningless, directly deleted. Select Y
Reload privilege tables now? [y/n] Y whether the previous setting takes effect, the modification equals the commit, the Y is selected
13. The next logon method after setting the password
Mysql-uroot-p (Specify login user root,-p enter password)
Enter Password:
This article is from the "Linux Learning log" blog, so be sure to keep this source http://guanm.blog.51cto.com/13126952/1971838
Binary installation mariadb-10.2.8