当前位置:Gxlcms > 数据库问题 > Linux 安装 mysql 转 http://www.cnblogs.com/fnlingnzb-learner/p/5830622.html

Linux 安装 mysql 转 http://www.cnblogs.com/fnlingnzb-learner/p/5830622.html

时间:2021-07-01 10:21:17 帮助过:29人阅读

 1 [root@rekfan.com test]# ls -il
 2 总计  0
 3 1491138 -rw-r–r– 1 root root 48 07-14 14:17 file1
 4 1491139 -rw-r–r– 2  root root 0 07-14 14:17 file2
 5 1491139 -rw-r–r– 2 root root 0 07-14 14:17  file2hand
 6 #建立file1和file1soft软连接
 7 [root@rekfan.com test]# ln -s file1  file1soft
 8 [root@rekfan.com test]# ls -il
 9 总计 0
10 1491138 -rw-r–r– 1 root  root 48 07-14 14:17 file1
11 1491140 lrwxrwxrwx 1 root root 5 07-14 14:24  file1soft -> file1
12 1491139 -rw-r–r– 2 root root 0 07-14 14:17  file2
13 1491139 -rw-r–r– 2 root root 0 07-14 14:17 file2hand
技术分享

其中,ln -s file1 filesoft 中的file1就是源文件,file1soft就是目标链接文件名,其作用是当进入filesoft目录,实际上是链接进入了file1目录

2.删除上面建立的软连接

技术分享
 1 [root@rekfan.com test]# ls -il
 2 总计  0
 3 1491138 -rw-r–r– 1 root root 0 07-14 14:17 file1
 4 1491140 lrwxrwxrwx 1  root root 5 07-14 14:24 file1soft -> file1
 5 1491139 -rw-r–r– 2 root root 0  07-14 14:17 file2
 6 1491139 -rw-r–r– 2 root root 0 07-14 14:17  file2hand
 7 #删除软连接
 8 [root@rekfan.com test]# rm -rf file1soft
 9 [root@rekfan.com test]#  ls -il
10 总计 0
11 1491138 -rw-r–r– 1 root root 0 07-14 14:17 file1
12 1491139  -rw-r–r– 2 root root 0 07-14 14:17 file2
13 1491139 -rw-r–r– 2 root root 0 07-14  14:17 file2hand
技术分享

 

 

启动mysql时显示:/tmp/mysql.sock 不存在的解决方法

技术分享
1 [root@localhost mysql]# bin/mysqladmin -u root password root
2 bin/mysqladmin: connect to server at ‘localhost‘ failed
3 error: ‘Can‘t connect to local MySQL server through socket ‘/tmp/mysql.sock‘ (2)‘
4 Check that mysqld is running and that the socket: ‘/tmp/mysql.sock‘ exists!
5 [root@localhost mysql]# bin/mysql -u root -p
6 Enter password:
7 ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/tmp/mysql.sock‘ (2)
8 分析:是/tmp/mysql.sock 不存在
技术分享

由于搜索的mysql.sock路径是在/tmp下,而mysql安装的mysql.sock在/var/lib/mysql下,所以选择建立符号(软)连接:

技术分享
1 # ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
2 # bin/mysql -u root
3 Welcome to the MySQL monitor. Commands end with ; or g.
4 Your MySQL connection id is 1
5 Server version: 5.0.45 MySQL Community Server (GPL)
6 Type ‘help;‘ or ‘h‘ for help. Type ‘c‘ to clear the buffer.
7 mysql>


Linux 安装 mysql 转 http://www.cnblogs.com/fnlingnzb-learner/p/5830622.html

标签:unit   http   upd   多个   就是   client   group   copy   nec   

人气教程排行