1、开机自启动mysql
最简易的方式,
我是在装系统时就装了mysql,
所以用whereis 等查找命令找到mysqld
然后编辑#vi /etc/rc.d/rc.local
加入
/etc/rc.d/init.d/mysqld start
重启即可
2、mysql编码修改
在 etc/my.cn中[mysqld]和[client]下加入,如果没有[client]自己写一个
default-character-set=utf8
登录mysql -uroot -p进入后用
show variables like 'character%';
查看一下编码
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
3、给mysql设置密码
刚开始装进去的mysql是没有密码的,所以启动mysql服务后设置
mysqladmin -u root password 123456