安装MYSQL

8 篇文章 0 订阅

安装MYSQL
程序:
MySQL-5.6.14-1.rhel5.x86_64.rpm-bundle.tar
解压:
tar xzvf MySQL-5.6.14-1.rhel5.x86_64.rpm-bundle.tar
解压后有一下rpm安装包

只需安装
MySQL-server-5.6.14-1.rhel5.x86_64.rpm
MySQL-client-5.6.14-1.rhel5.x86_64.rpm
安装:
rpm –ivh MySQL-server-5.6.14-1.rhel5.x86_64.rpm
rpm –ivh MySQL-client-5.6.14-1.rhel5.x86_64.rpm
netstat –nat
查看3306端口是否开启,若开启则说明安装成功
登录mysql
mysql -u root –p
默认密码在文件/root/.mysql_secret中
登录成功后,修改密码
mysql> SET PASSWORD = PASSWORD(‘hundsun’);
登录成功后,修改最大连接数
mysql> set global max_connections = 3600;

注:查询最大连接数的SQL:
select VARIABLE_VALUE from information_schema.GLOBAL_VARIABLES where VARIABLE_NAME=’MAX_CONNECTIONS’;
删除匿名帐号:
delete from user where user=” ;
删除密码为空的帐号:
delete from user where password=”;
重新登录
mysql>use mysql;
mysql>update user set host = ‘%’ where user = ‘root’;
mysql>select host, user from user;
mysql>FLUSH PRIVILEGES;
启动和关闭:
启动:service mysql start
关闭:service mysql stop
主从配置:
主:/etc./my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
symbolic-links=0
log-bin=mysql-bin
server-id=254
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/lib/mysql/localhost.localdomain.pid
character_set_server=utf8
lower_case_table_names=1
从:/etc./my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
symbolic-links=0
log-bin=mysql-bin
server-id=243
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
character_set_server=utf8
lower_case_table_names=1

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值