系统环境:centos7
安装mariadb-server
yum install mariadb-server
开启服务systemctl start mariadb
安装mariadb
yum install mariadb
登陆数据库mysql -uroot -p
默认是没有密码的,直接回车登陆就好1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21[root@centos studynote]# mysql -uroot -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 4
Server version: 5.5.44-MariaDB MariaDB Server
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 databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
| westos |
+--------------------+
5 rows in set (0.00 sec)
安装mysql++和安装mysql++-devel
yum install mysql++
yum install mysql++-devel
装完之后查找mysql.h 和 mysqlclient.so所在的目录
分别为/usr/include/mysql/mysql.h
/usr/lib64/mysql/libmysqlclient.so
所以在编程中,如果需要使用mysql.h
在编译的时候需要指定头文件和连接库的位置-I/usr/include/mysql -L/usr/lib64/mysql