`
lvyanglin
  • 浏览: 84325 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

linux rathat5 安装mysql5.1 步骤

阅读更多
1.安装linux
2.安装mysql,安装本人经验下载二进制解压版安装比较合适
http://mysql.cdpa.nsysu.edu.tw/Downloads/MySQL-5.1/mysql-5.1.54-linux-i686-glibc23.tar.gz
3.将解压之后将mysql-5.1.54-linux-i686-glibc23.tar.gz 拷到/user/local
引用
必须这样放在当前用户目录在后面步骤会出现问题

 mv  mysql-5.1.54-linux-i686-glibc23   /usr/local/
 

4.解压gz包到当前目录
  [root@esunny local]# tar -vxf mysql-5.1.54-linux-i686-glibc23.tar.gz

5.在这一步执行scripts/mysql_install_db  --user=mysql的时候如果发现出现db.MYI错误 您就看看你mysql是否拷到/usr/local中

[root@esunny local]# groupadd  mysql
[root@esunny local]# useradd -g mysql mysql
[root@esunny local]# ln -s mysql-5.1.54-linux-i686-glibc23 mysql
[root@esunny local]# cd mysql
[root@esunny mysql]# scripts/mysql_install_db  --user=mysql
Installing MySQL system tables...
OK
Filling help tables...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

./bin/mysqladmin -u root password 'new-password'
./bin/mysqladmin -u root -h esunny password 'new-password'

Alternatively you can run:
./bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd . ; ./bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd ./mysql-test ; perl mysql-test-run.pl

Please report any problems with the ./bin/mysqlbug script!


6.到目前为止所有要安装的步骤都搞定了,接下来我们登陆数据库看看
  [root@esunny mysql]# bin/mysql -uroot

结果出现错误:
[root@esunny mysql]# bin/mysql -uroot
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

出现上述错误后,我想了很多办法去解决,但是都没解决应该就是权限的问题,但是我设置tmp权限后还是报错在网站找了很多资料都没结果后来看到一个高手

I got a error message whene I completed the installation and try to start the mysql:
#mysql 
ERROR 2002:Can't connect to local MySQL server through cocket '/tmp/mysql.sock'(2) 

How can I solve this problem?


解决方法如下:
第一种方法:You do not have mysql running when you tried to access the mysql commandline.  You first need to run

# /usr/local/etc/rc.d/mysql-server.sh start

and then you will be able to connect to mysql. 

第二种方式:
#/usr/local/bin/mysqld_safe & 
然后:
#mysql
  


肯定一切ko


我采用了第二种办法解决问题的
其实不是什么解决方案,知识启动 mysql而已


分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics