How to run/check MySql?

Hello group,

This is the first time I am using MySql so I will appreciate it if you advise me on this quesiton.

I'm connectiong to a linux server from a machine. I'm told tht MySql is installed. However, when I check /var/lib/  there is no sign of MySQL. but when I run:

        rpm -qa | grep mysql

it responds fine.
1) How can I find where msql has been installed?
2) How can I run mysql?


Thanks,
ak
akohanAsked:
Who is Participating?
 
msklizmantasCommented:
hi,

you do not have mysql server installed. you can install it with yum:

yum install mysql-server

or you can download rpms from www.mysql.com and install using rpm -Uhv

regards,

m
0
 
msklizmantasCommented:
hi,

rpm -qa | grep mysql

only list software (if it is installed). please provide us the output from

rpm -qa | grep -i mysql

so we can check what it is installed. after it you will get smth like:

mysql-server-4.1.20-2.RHEL4.1

try to list contents with:

rpm -ql mysql-server-4.1.20-2.RHEL4.1

also you can check if /etc/init.d/mysql exists.

regards,

m

0
 
hernst42Commented:
Try to start the mysql-server with:

/etc/init.d/mysql start

if there is no /etc/init.d/mysql then there might be no mysql-server installed. Whats the output of
rpm -qa | grep -i mysql
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

 
akohanAuthor Commented:


Thanks!

I ran the first command and I got:
         
               mysql-5.0.22-2.1

However, when I get to /etc/init.d/  mysql doesn't exist there.

I also ran the following command but got error and have no idea how to fix or what to do about it. Any suggestions?


[root@omega bin]# /usr/bin/mysqladmin version
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!

[root@omega bin]# /usr/bin/mysqladmin variables
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!

Regards,
ak


0
 
hernst42Commented:
In this case no mysql-server-package is installed. Use the package-management system of your distribution (which distro are you using) to install the missing server component. Sure ther is a search-function where you can search for mysql and check the server package.
0
 
akohanAuthor Commented:

Thanks all. it is working now.

I truly appreciate your help.

Regards,
ak
0
 
akohanAuthor Commented:

Do you suggest I read a book  (then what book?) or is there any online guide to learn MySQL? (what is the address?)

Thanks.
0
 
msklizmantasCommented:
of course there are many guides and tutorials online, you can easily find them using google. but i would suggest to get good book, such as:

The Definitive Guide to MySQL 5 # By Michael Kofler
# ISBN10: 1-59059-535-1
# ISBN13: 978-1-59059-535-0


and afterwards:

Pro MySQL # By Michael Kruckenberg, Jay Pipes
# ISBN10: 1-59059-505-X
# ISBN13: 978-1-59059-505-3

regards,

m
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.