针对
Linux系统自带
Mysql 数据库不能使用的情况,可能是在安装过程有没有安装
mysql server,
安装时即使选了安装
MYSQL(图形界面安装),只有打开旁边“细节”,从里面勾选选上
server才可以。安装完成后在
/usr/bin 目录下会生成许多
MySQL的相关文件,其中有一个名为
mysqld_safe 启动服务的脚本文件,执行这个脚本文件后,发现错误
"/var/lib/mysql/mysql.sock", 查看
mysql服务才发现,没有起来,于是执行
/etc/init.d/mysqld start,启动服务后,在
/usr/bin 执行
mysql 成功进入数据库!
[pan@localhost ~]$ su – root Password:[root@localhost ~]# cd /usr/bin [root@localhost bin]# ./mysqld_safe --user=root &[1] 12969[root@localhost bin]# Starting mysqld daemon with databases from /var/lib/mysqlSTOPPING server from pid file /var/run/mysqld/mysqld.pid090606 15:20:04 mysqld endedmysqlERROR 2002 (HY000): Can"t connect to local MySQL server through socket "/var/lib/mysql/mysql.sock" (2)[1]+ Done ./mysqld_safe --user=root[root@localhost bin]# mysqlERROR 2002 (HY000): Can"t connect to local MySQL server through socket "/var/lib/mysql/mysql.sock" (2)[root@localhost bin]# /etc/rc.d/init.d/mysqld statusmysqld is stopped[root@localhost bin]# /etc/init.d/mysqld start (或者
service mysqld restart,而
service mysqld stop 停止
mysql的服务)
Initializing MySQL database: [ OK ]Starting MySQL: [ OK ][root@localhost bin]# mysqlWelcome to the MySQL monitor. Commands end with ; or g.Your MySQL connection id is 2 to server version: <?XML:NAMESPACE PREFIX = ST1 />4.1.22Type "help;" or "h" for help. Type "c" to clear the buffer.mysql>现在进行环境变量的配置,可以针对用户配置用户的环境变量,以
root用户例,
[root@localhost bin]# cd[root@localhost ~]# ls –a (
.bash_profile 是个隐藏文件,所以要
-a)
. Desktop .gstreamer-0.8 .mozilla.. .dmrc .gtkrc .mysql_historyanaconda-ks.cfg .eggcups .gtkrc-1.2-gnome2 .nautilus.bash_history .fullcircle .ICEauthority .recently-used.bash_logout .gconf .icons .rhn-applet.conf.bash_profile .gconfd install.log .tcshrc.bashrc .gnome install.log.syslog .viminfo.config .gnome2 .kde .xauthC1s54N.cshrc .gnome2_private .metacity .xautheKBniS[root@localhost ~]# vi .bash_profile (进行修改)# .bash_profile# Get the aliases and functionsif [ -f ~/.bashrc ]; then . ~/.bashrcfi# User specific environment and startup programsPATH=$PATH:$HOME/bin:/usr/bin (此处添加注意冒号)
export PATHunset USERNAME[root@localhost ~]# source .bash_profile (更新一下配置文件)也可以针对系统环境配置,如下:
[root@localhost ~]# vi /etc/profile# /etc/profile# System wide environment and startup programs, for login setup# Functions and aliases go in /etc/bashrcpathmunge () { if ! echo $PATH | /bin/egrep -q "(^|:)$1($|:)" ; then if [ "$2" = "after" ] ; then PATH=$PATH:$1 else PATH=$1:$PATH fi fi}# Path manipulationif [ `id -u` = 0 ]; then pathmunge /sbin pathmunge /usr/sbin pathmunge /usr/local/sbin pathmunge /usr/binfiRHEL AS 5 X86_64如何卸载Oracle 10g红旗Asianux3下Oracle 10g无法启动解决相关资讯 mysql
- 数据库服务器 MySQL (08/15/2013 06:50:23)
- MySQL 5.6 GA 及逃亡潮 (02/08/2013 14:36:35)
- MySQL 5.5.22、5.1.62、5.0.96全线 (03/22/2012 19:03:49)
| - MySQL Administrator连接VMWare下 (05/24/2013 09:20:58)
- MySQL 5.1.68 发布 (02/05/2013 08:37:47)
- CentOS 5.2+MySQL+Heartbeat双机互 (01/29/2012 11:16:55)
|
本文评论 查看全部评论 (0)