linux下mysql改权限吗_linux下安装MySQL及修改权限和用户

1.检查以前安装的MySQL,卸载。rpm -qa|grep -i mysql

rpm -e XXXXX

注:如果出现两条相同的,则使用rpm -e --allmatches

2.cp参数文件到/etc/my.cnf(注意调整my.cnf内存大小)

3.安装rpm包。

rpm -ivh MySQL-server-5.5.8-1.rhel5.x86_64.rpm

rpm -ivh MySQL-client-5.5.8-1.rhel5.x86_64.rpm

rpm -ivh MySQL-devel-5.5.8-1.rhel5.x86_64.rpm

rpm -ivh MySQL-shared-5.5.8-1.rhel5.x86_64.rpm

rpm -ivh MySQL-shared-compat-5.5.8-1.rhel5.x86_64.rpm

4.更新权限及用户

mysql -u root -p

use mysql;

select user,host from user;

delete from user where user <> 'root';

delete from user where host <> 'localhost';

update user set host ='%' where user ='root';

select user,host from user;

更新user表到如下状态

mysql> select user,host from user;

+------+------+

| user | host |

+------+------+

| root | % |

+------+------+

1 row in set (0.00 sec)

创建用户

grant select,insert,update,delete,create,drop,alter,index, lock tables, execute, create routine, alter routine,Create temporary tables

on *.* to mysql@"%" identified by "123456";

更新权限

flush privileges;

5.设置密码(123456)

mysqladmin -u root -p password ufsoft

####mysqladmin -u root -p password mypasswd

6.重启服务,验证设置。

/etc/init.d/mysql restart

登陆mysql

卸载驱动

rpm -e --justdb mysql-connector-odbc-5.1.5-0

数据库启动命令:

ps aux|grep mysql

解压包:tar zxvf  ****.tar.gz

导入数据:mysql –uroot –p123456 ename_222.sql

导出数据: mysql dump

改数据库配置:

set global tmp_table_size=2009715200

set global max_heap_table_size=2009715200

分享到:

18e900b8666ce6f233d25ec02f95ee59.png

72dd548719f0ace4d5f9bca64e1d7715.png

2011-07-11 09:04

浏览 2400

分类:数据库

评论

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值