A soft connection to the path of the Linux MySQL database database

Source: Internet
Author: User

CENTOS7 below

[email protected] mysql]# service mysqld Restart
redirecting to/bin/systemctl restart Mysqld.service
[email protected] mysql]# mysql-uroot-p123456
Welcome to the MariaDB Monitor. Commands End With; or \g.
Your MariaDB Connection ID is 2
server version:10.1.21-mariadb MariaDB server

Copyright (c), Oracle, MariaDB Corporation Ab and others.

Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.

MariaDB [(none)]> use Daochudata
Database changed
MariaDB [daochudata]> CREATE TABLE t (id int);
ERROR 1005 (HY000): Can ' t create table ' daochudata '. ' t ' (errno:13 "Permission denied")
MariaDB [daochudata]> User Cardid
;
error 1064 (42000): You have a ERROR in your SQL syntax; check the manual, corresponds to your MariaDB server ver Sion for the right syntax to use near ' user Cardid ' at line 1
MariaDB [daochudata]> Use sedata1
Reading table information for completion of table and column names
can turn off this feature to get a quicker startup With-a

Database changed
MariaDB [sedata1]> CREATE TABLE t1 (id int);
Query OK, 0 rows affected (0.38 sec)

MariaDB [sedata1]> drop table T1;
Query OK, 0 rows affected (0.08 sec)

MariaDB [sedata1]> CREATE database daochudata;
Query OK, 1 row Affected (0.00 sec)

MariaDB [sedata1]> Use Daochudata
Database changed
MariaDB [daochudata]> CREATE TABLE A (id int);
Query OK, 0 rows affected (0.33 sec)

MariaDB [daochudata]>
-rw-rw----. 1 mysql mysql 33243136 February 16:45 zhilianzhaopin. MAI
-rw-rw----. 1 mysql mysql 6581 February 7 11:17 zhuoyue.frm
-rw-rw----. 1 mysql mysql 7847936 February 13:38 Zhuoyue. MAD
-rw-rw----. 1 mysql mysql 2465792 February 16:45 Zhuoyue. MAI
[email protected] sedata1]# CD .
[email protected] data1]# ll
Total Dosage
drwxrwxrwx. 2 mysql mysql 4096 May 15:58 daochudata
drwxrwxrwx. 5 root root 4096 February 11:40 dataprocess
drwxrwxrwx. 2 mysql mysql 32768 May 16:06 sedata1
drwxrwxrwx. 2 mysql mysql 16384 March 08:48 sedata2
drwxrwxrwx. 2 mysql mysql 12288 April 7 09:07 sedata3
drwxrwxrwx. 2 mysql mysql 4096 February 4 14:28 sedata4
drwxrwxrwx. 2 mysql mysql 4096 February 4 14:28 sedata5
[email protected] data1]# RM daochudata
RM: Cannot delete "Daochudata": is a directory
[email protected] data1]# RM-RF daochudata
[email protected] data1]# mv/var/lib/mysql/daochudata.
[email protected] data1]# ll
Total Dosage
drwx------. 2 mysql mysql 4096 May 16:08 daochudata
drwxrwxrwx. 5 root root 4096 February 11:40 dataprocess
drwxrwxrwx. 2 mysql mysql 32768 May 16:06 sedata1
drwxrwxrwx. 2 mysql mysql 16384 March 08:48 sedata2
drwxrwxrwx. 2 mysql mysql 12288 April 7 09:07 sedata3
drwxrwxrwx. 2 mysql mysql 4096 February 4 14:28 sedata4
drwxrwxrwx. 2 mysql mysql 4096 February 4 14:28 sedata5
[email protected] data1]# Cd/var/lib/mysql
[email protected] mysql]# ln-s/media/data1/daochudata/daochudata
[email protected] mysql]# CD Daochudata
[email protected] daochudata]# ll
Total Dosage 104
-rw-rw----. 1 mysql mysql 433 May 16:11 a.frm
-rw-rw----. 1 mysql mysql 98304 May 16:11 a.ibd
-rw-rw----. 1 mysql mysql 65 May 16:08 db.opt


Soft connection of Centos7
[Email protected] mysql]# mysql-uroot-p123456
Welcome to the MariaDB Monitor. Commands End With; or \g.
Your MariaDB Connection ID is 54
Server VERSION:10.0.28-MARIADB MariaDB Server

Copyright (c), Oracle, MariaDB Corporation Ab and others.

Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.

MariaDB [(None)]> show databases;
+--------------------+
| Database |
+--------------------+
| AA |
| datapart10 |
| DumpData |
| Icplatform |
| Information_schema |
| Jiudian |
| Mass |
| MySQL |
| Performance_schema |
| Test |
| Txtdata |
| Webauth |
| Webpass |
+--------------------+
Rows in Set (0.00 sec)

MariaDB [(None)]> CREATE Database daochudata;
Query OK, 1 row Affected (0.00 sec)

MariaDB [(None)]> show tables;
ERROR 1046 (3d000): No Database selected
MariaDB [(None)]> show databases;
+--------------------+
| Database |
+--------------------+
| AA |
| Daochudata |
| datapart10 |
| DumpData |
| Icplatform |
| Information_schema |
| Jiudian |
| Mass |
| MySQL |
| Performance_schema |
| Test |
| Txtdata |
| Webauth |
| Webpass |
+--------------------+
Rows in Set (0.00 sec)

MariaDB [(None)]> use Daochudata;
Database changed
MariaDB [daochudata]> CREATE TABLE t (id int);
Query OK, 0 rows affected (0.56 sec)

MariaDB [daochudata]>






A soft connection to the path of the Linux MySQL database database

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.