版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/lineuman/article/details/82949374
如果是直接使用阿里云的mysql数据库,很简单,配置也是别人配好了的,但价格并不亲民,本文讲述自己搭建mysql服务要知道的一些事情。
linux上安装
cat /etc/system-release
CentOS release 6.9 (Final)
yum install mysql mysql-server mysql-lib
rpm -aq|grep mysql
mysql-5.1.73-8.el6_8.x86_64
mysql-server-5.1.73-8.el6_8.x86_64
mysql-libs-5.1.73-8.el6_8.x86_64
如果你曾经删除过mysql数据库文件,那么最好执行下mysql_install_db
配置
-
设置密码
-
中文字符串的支持
show variables like “character_set_database”;
utf8mb4
alter database testapi charset=utf8
show full columns from table_name
ALTER TABLE article CONVERT TO CHARACTER SET utf8; -
内置存储引擎
show engines; 可以查看有哪些引擎
你可以通过show create table 来查看数据表使用的存储引擎
通过如下修改全局的默认配置
In the my.cnf file, locate the [mysqld] section.
default-storage-engine=InnoDB