• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1047
  • Last Modified:

mySQL problem

Hi,

I installed mysql4 through yum install mysql or also tried to install
mysql5 via its rpm, both installed fine. However when i type
mysql or mysqladmin in root, it says command not found!

My mysql is running and i tried to do this but it failed.

# /usr/local/mysql/bin/mysqladmin create dd
/usr/local/mysql/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!

# /usr/local/mysql/bin/mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

# ps ax|grep mysql
10839 ?        S      0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/dual.server.com.pid
10860 ?        Sl     0:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/dual.server
0
jedistar
Asked:
jedistar
1 Solution
 
sundeepgopalCommented:
wat does " ls -ld  /tmp"  and "ls -ld /private/tmp" give ??
0
 
xDamoxCommented:
Hi,

I would suggest removing MySQL 4 type the following:

rpm -qa | grep mysql

Get the correct version you want removed and type

yum remove mysql-version

Once you have done that make sure no mysql processes are running

ps aux | grep mysql

if there are some kill them and type:

service mysqld start

This will start mysql for you.

0
 
ahoffmannCommented:
> it says command not found!
you either have /usr/local/mysql/bin not in your PATH environment variabel, or you're using csh which needs a refresh

> My mysql is running and i tried to do this but it failed.
> # /usr/local/mysql/bin/mysqladmin create dd
> /usr/local/mysql/bin/mysqladmin: connect to server at 'localhost' failed
> error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
> Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!
your /etc/my.cnf and/or your my.cnf contains a wrong
 socket=
either correct that file or start your commands with the proper -s option
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
jedistarAuthor Commented:
# ls -ld  /tmp
drwxrwxrwt  3 root root 4096 May 10 04:02 /tmp
# ls -ld /private/tmp
ls: /private/tmp: No such file or directory

# /usr/local/mysql/bin/mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

# ps aux|grep my
root     10839  0.0  0.1   4340  1104 ?        S    May08   0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/dual.server.com.pid
mysql    10860  0.0  1.4 106016 14680 ?        Sl   May08   0:01 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/dual.server.com.pid --skip-locking
0
 
jedistarAuthor Commented:
# ls -aul /tmp/mysql.sock
ls: /tmp/mysql.sock: No such file or directory
0
 
jedistarAuthor Commented:
Removed: MySQL-server-standard.i386 0:4.1.19-0.rhel3
Complete!
# service mysqld start
mysqld: unrecognized service
0
 
jedistarAuthor Commented:
tried all the options above.
0
 
ahoffmannCommented:
did you read my suggestion http:#16642251 ?
simply follow instructions there ;-)
0
 
ppfoongCommented:

You have MySQL-server installed, but probably the MySQL-client is not installed yet.

Try to yum MySQL-client. This will get the client.

0
 
jedistarAuthor Commented:
No Match for argument: MySQL-client
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now