安装mysql及解决乱码问题

    xiaoxiao2021-03-25  115

    一、安装mysql 1、apt安装:sudo apt-get install mysql-server 2、下载源码安装:http://dev.mysql.com/downloads/mysql/5.6.html#downloads 3、解决中文乱码:修改my.cnf,加入 [client] default-character-set = utf8 [mysqld] character-set-server = utf8

    重启mysql: service mysql restart / service mysqld restart / /etc/init.d/mysqld restart

    4、进入mysql:    mysql -uroot -p ,show variables like 'chra%'  查看是否都是utf8

    5、查看当前数据库编码:use 数据库名; status; 

    转载请注明原文地址: https://ju.6miu.com/read-13706.html

    最新回复(0)