linux 环境 mysql简单的安装

不清楚源码编译的好处,且麻烦,因此本人使用yum工具在linux下进行安装,步骤如下:


1:yum install mysql

2:yum install mysql-server


3: yum install mysql-devel


4:chgrp -R mysql /var/lib/mysql


5: chmod -R 770 /var/lib/mysql


6: service mysqld start

      

Tostart mysqld at boot timeyou have to copy

support-files/mysql.serverto the right place foryour system

 

PLEASEREMEMBER TO SET A PASSWORD FOR THE MySQL root USER !

Todoso, start the server, thenissue the following commands:

/usr/bin/mysqladmin-uroot password 'new-password'

/usr/bin/mysqladmin-uroot -h LAMP.ORG password 'new-password'

 

Alternativelyyou can run:

/usr/bin/mysql_secure_installation

 

whichwillalso give you the option of removing the test

databasesand anonymous user created by default.  This is

stronglyrecommended forproduction servers.

 

Seethe manual formoreinstructions.

 

Youcan start the MySQL daemon with:

cd/usr;/usr/bin/mysqld_safe&

 

Youcan testthe MySQL daemon with mysql-test-run.pl

cdmysql-test;perl mysql-test-run.pl

 

Pleasereport any problems with the /usr/bin/mysqlbugscript!

 

Thelatest information about MySQL is available on the web at

 

http://www.mysql.com

 

SupportMySQL by buying support/licensesat http://shop.mysql.comz


       可以使用netstat 命令查看3306端口是否已经启动

       netstat -antp|grep 3306


7 : /usr/bin/mysqladmin -u root password'123456', 设置root密码:

    

8 登陆mysql:   mysql -uroot -p123456   注意 -u和-p后面直接加用户名和密码,不要有空格


出现myslq的命令界面说明已经启动正确,如果用户想在本机操作远程的mysql数据库,一开始是不行的,mysql会限定了ip访问,默认的是只允许本机访问,

如果想要在本机操作mysql,需要执行下面的命令,可根据自己的需求进行修改,因为我这没有什么安全限制,因此,将ip访问全部放开:

步骤:

一)use mysql

二)执行:

GRANT ALL PRIVILEGES ON *.* TO 'im'@'%'IDENTIFIED BY 'im' WITH GRANT OPTION;

解释:让im用户使用im密码从任何服务器主机链接到mysql服务器 %’表示所有的服务器


最后执行: 

flush privileges;

否则不会生效,至此完成,用户可以在本机下载一个工具操作mysql了,哈哈。。本人用的是navicat,网上有很多破解版,希望对各位有帮助;


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值