您的位置:首页 > 数据库 > MySQL

Unbuntu下Mysql安装和简单配置

2015-04-18 17:14 423 查看
ubuntu搭建mysql 参考http://www.cnblogs.com/wuhou/archive/2008/09/28/1301071.html
1. sudo apt-get install mysql-server\
需要制定root密码password吧
2. vi /etc/mysql/my.cnf
注释掉binding-address=127.0.0.1
3.如果需要在服务器端配置mysql,安装mysql-client
mysql -u root p
4. 如果需要远程连接数据库服务器,需要开启权限(默认是不可以远程连接的:navicat 1130错误)
mysql> grant all privileges on *.* to root@"%" identified by "password" with grant option; (任何主机均可以)
grant all privileges on *.* to root@"192.168.1.3" identified by "password" with grant option; flush privileges(指定主机)

注意mysql库中的user表记录了连接信息
5. 修改字符集 (注意乱码问题http://www.2cto.com/database/201108/101151.html)
查看当前的编码:show variables like 'character%';
修改my.cnf,在[client]下添加default-character-set=utf8
create database ‘sb’ character et 'utf8'
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: