[root@HE3 ~]# /usr/local/mysql/bin/mysql -uroot -p -P3306
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.25-log MySQL Community Server (GPL)
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> select version();
+------------+
| version() |
+------------+
| 5.6.25-log |
+------------+
1 row in set (0.01 sec)
mysql>
[root@HE3 ~]# /etc/init.d/mariadb start
Starting MySQL SUCCESS!
[root@HE3 ~]# ps -ef|grep mysql
root 29008 1 0 16:51 pts/2 00:00:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/data/mysql --pid-file=/data/mysql/HE3.pid
mysql 29754 29008 0 16:51 pts/2 00:00:00 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/data/mysql --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/log/mysql/error.log --open-files-limit=3072 --pid-file=/data/mysql/HE3.pid --socket=/tmp/mysql.sock --port=3306
root 29802 1 0 16:52 pts/2 00:00:00 /bin/sh /usr/local/mariadb/bin/mysqld_safe --defaults-file=/usr/local/mariadb/my.cnf --datadir=/data/mariadb --pid-file=/data/mariadb/HE3.pid
mariadb 30041 29802 7 16:52 pts/2 00:00:00 /usr/local/mariadb/bin/mysqld --defaults-file=/usr/local/mariadb/my.cnf --basedir=/usr/local/mariadb --datadir=/data/mariadb --plugin-dir=/usr/local/mariadb/lib/plugin --user=mariadb --log-error=/log/mariadb/error.log --open-files-limit=3072 --pid-file=/data/mariadb/HE3.pid --socket=/tmp/mariadb.sock --port=3307
root 30070 2226 0 16:52 pts/2 00:00:00 grep mysql
[root@HE3 ~]# /usr/local/mariadb/bin/mysql -uroot -p -P3307
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 5.6.25-log MySQL Community Server (GPL)
Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> select version();
+-----------------+
| version() |
+-----------------+
| 10.1.16-MariaDB |
+-----------------+
1 row in set (0.00 sec)
也可以手动启停
启动命令
[root@HE3 ~]# /usr/local/mariadb/bin/mysqld_safe --defaults-file=/etc/mariadb.cnf --ledir=/usr/local/mariadb/bin --datadir=/data/mariadb &
停止命令
[root@HE3 ~]# /usr/local/mariadb/bin/mysqladmin --defaults-file=/usr/local/mariadb/my.cnf -hlocalhost -P3307 shutdown