1、上传MariaDB 10.7.3二进制包到/usr/local/src目录下
# cd /usr/local/src/
# rz
rz waiting to receive.
Starting zmodem transfer. Press Ctrl+C to cancel.
Transferring mariadb-10.7.3-linux-systemd-x86_64.tar.gz...
100% 338007 KB 24143 KB/sec 00:00:14 0 Errors
# ll
-rw-r--r-- 1 root root 346120004 Apr 11 03:12 mariadb-10.7.3-linux-systemd-x86_64.tar.gz
2、解压包,并将解压后的目录移动到/usr/local/mysql目录下
# tar -xzf mariadb-10.7.3-linux-systemd-x86_64.tar.gz
# mv mariadb-10.7.3-linux-systemd-x86_64 /usr/local/mysql
# cd ../mysql
# ls
bin COPYING CREDITS include INSTALL-BINARY lib man mysql-test README.md README-wsrep scripts share sql-bench support-files THIRDPARTY
3、创建数据目录
# mkdir -p /data/mysql
4、创建mysql用户和组,并为目录赋mysql用户和组权限
# groupadd mysql
# useradd -d /data/mysql -g mysql mysql
# chown -R mysql.mysql /data/mysql /usr/local/mysql
5、安装MariaDB
# cd /usr/local/mysql
# ./scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql --skip-name-resolve --user=mysql
Installing MariaDB/MySQL system tables in '/data/mysql' ...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
Two all-privilege accounts were created.
One is root@localhost, it has no password, but you need to
be system 'root' user to connect. Use, for example, sudo mysql
The second is mysql@localhost, it has no password either, but
you need to be the system 'mysql' user to connect.
After connecting you can set the password, if you would need to be
able to connect as any of these users with a password and without sudo
See the MariaDB Knowledgebase at https://mariadb.com/kb
You can start the MariaDB daemon with:
cd '/usr/local/mysql' ; /usr/local/mysql/bin/mysqld_safe --datadir='/data/mysql'
You can test the MariaDB daemon with mysql-test-run.pl
cd '/usr/local/mysql/mysql-test' ; perl mysql-test-run.pl
Please report any problems at https://mariadb.org/jira
The latest information about MariaDB is available at https://mariadb.org/.
Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-involved/
# cd /data/mysql/
# ll
total 111020
-rw-rw---- 1 mysql mysql 409600 Apr 14 03:10 aria_log.00000001
-rw-rw---- 1 mysql mysql 52 Apr 14 03:10 aria_log_control
-rw-rw---- 1 mysql mysql 942 Apr 14 03:10 ib_buffer_pool
-rw-rw---- 1 mysql mysql 12582912 Apr 14 03:10 ibdata1
-rw-rw---- 1 mysql mysql 100663296 Apr 14 03:10 ib_logfile0
drwx------ 2 mysql mysql 4096 Apr 14 03:10 mysql
-rw-r--r-- 1 root root 14 Apr 14 03:10 mysql_upgrade_info
drwx------ 2 mysql mysql 20 Apr

最低0.47元/天 解锁文章
3161

被折叠的 条评论
为什么被折叠?



