LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   mysql version (https://www.linuxquestions.org/questions/linux-newbie-8/mysql-version-854789/)

elainelaw 01-07-2011 02:59 AM

mysql version
 
I would like to know the version mysql in my server , I use phpinfo.php to check the version .

the following is the result
mysql
=====
MySQL Support enabled
Active Persistent Links 0
Active Links 0
Client API version 3.23.49
MYSQL_MODULE_TYPE builtin
MYSQL_SOCKET /tmp/mysql.sock
MYSQL_INCLUDE no value
MYSQL_LIBS no value

does it mean the mysql server version is 3.23.49 ? or it only a client version ?

Thanks.

novice06 01-07-2011 03:03 AM

If you use rpm based linux
rpm -qi mysql
You can find
Version : 5.0.77

linuxlover.chaitanya 01-07-2011 03:04 AM

My MySQL version and the client api version are same on phpinfo.

EricTRA 01-07-2011 03:09 AM

Hi,

Open a mysql session from terminal:
Code:

mysql -uroot -p
that'll show you the version of MySQL server you're running
Code:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.0.77 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

Kind regards,

Eric

elainelaw 01-07-2011 03:35 AM

Quote:

Originally Posted by novice06 (Post 4216230)
If you use rpm based linux
rpm -qi mysql
You can find
Version : 5.0.77

I am not use rpm

elainelaw 01-07-2011 03:37 AM

Quote:

Originally Posted by EricTRA (Post 4216236)
Hi,

Open a mysql session from terminal:
Code:

mysql -uroot -p
that'll show you the version of MySQL server you're running
Code:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.0.77 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

Kind regards,

Eric

I tried root password but not work , can advise what is the mysql password ?

#mysql -uroot -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib
/mysql/mysql.sock' (2)

Sayan Acharjee 01-07-2011 03:44 AM

Quote:

Originally Posted by elainelaw (Post 4216254)
I tried root password but not work , can advise what is the mysql password ?

#mysql -uroot -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib
/mysql/mysql.sock' (2)

The default socket mysql is using to connect is not valid, may be you have more than one Mysql installed in your system. Find the valid socket and run the command again with --socket=path_to_valid_socket

EricTRA 01-07-2011 03:44 AM

Hello,

Have you not set a password for the MySQL root user? Try without the -p option, like this:
Code:

mysql -uroot
If you get a prompt like this:
Code:

mysql>
then you're at the mysql console.

I advise you to set a password for the MySQL root user if your server is a production server or accessible from the outside. Of course if you already have applications (PHPMyAdmin or so) in place you'll have to change their configuration accordingly if you set a password.

A password for MySQL (if not set before) can be set using:
Code:

mysqladmin -u root password YOURPASSWORD
Kind regards,

Eric

novice06 01-07-2011 03:55 AM

Can you check your mysql process is running
ps aux |grep mysql
Seem like it is not running. So that you cannot connect with mysql client

danielle 01-07-2011 05:03 AM

Hi,
after entering the mysql console, try this:
Code:

mysql> select version();
that would show the server's version


All times are GMT -5. The time now is 03:32 AM.