LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-21-2007, 06:57 AM   #1
gubak
Member
 
Registered: Jul 2004
Posts: 332

Rep: Reputation: 30
Do I have mysql server installed?


Hi!

I have CentOS 4 instaled. Throught the installation process between the other servers (web, mail, proxy...), I've checked the mysql server. After the installation process every installed server works except the mysql. I have tired "service mysqld start" but the system gets me the warning "unrecognized service".

How can I be sure that the mysql is installed or not?

Last edited by gubak; 04-13-2007 at 12:53 AM.
 
Old 03-21-2007, 07:04 AM   #2
remargorp
LQ Newbie
 
Registered: Mar 2007
Posts: 4

Rep: Reputation: 0
You can try:
Code:
$ locate mysql
Or (as root)...
Code:
# find / -name mysql -print
Hope that helps!
 
Old 03-21-2007, 08:32 AM   #3
gubak
Member
 
Registered: Jul 2004
Posts: 332

Original Poster
Rep: Reputation: 30
I have run command
find / -name mysql -print
and it finded me the following result:

/usr/lib/mysql
/usr/bin/mysql
/usr/include/mysql
/usr/share/mysql


Does it mean that mysql was installed on my system?
If installed, how can I start it?


Thanks
 
Old 03-21-2007, 08:44 AM   #4
asommer
Member
 
Registered: Mar 2003
Location: North Carolina
Distribution: Gentoo
Posts: 168

Rep: Reputation: 30
You can use rpm to make sure you have the server installed:

Quote:
rpm -qa | grep mysql
You'll want to look for these packages being installed:

Quote:
mysql-server-4.1.20-1.RHEL4.1
mysql-devel-4.1.20-1.RHEL4.1
mysqlclient10-3.23.58-4.RHEL4.1
mysql-4.1.20-1.RHEL4.1
 
Old 03-21-2007, 08:54 AM   #5
gubak
Member
 
Registered: Jul 2004
Posts: 332

Original Poster
Rep: Reputation: 30
The following appears at me:


mysql-devel-4.1.20-1.RHEL4.1
mysql-4.1.20-1.RHEL4.1
libdbi-dbd-mysql-0.6.5-10.RHEL4.1
mysqlclient10-3.23.58-4.RHEL4.1
 
Old 03-21-2007, 09:07 AM   #6
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 74
I think you only have the client installed. If you had the server installed, a package called "mysql-server" would be in that list.
 
Old 03-21-2007, 09:33 AM   #7
asommer
Member
 
Registered: Mar 2003
Location: North Carolina
Distribution: Gentoo
Posts: 168

Rep: Reputation: 30
I agree with reddazz. You should be able to install it by:

Quote:
yum install mysql-server
 
Old 03-23-2007, 02:46 AM   #8
gubak
Member
 
Registered: Jul 2004
Posts: 332

Original Poster
Rep: Reputation: 30
Thank you, it's working now.

When I started mysqld, it opened a port 3306. I use mysql server only for website. Do I need this port?
Let me ask one more question:
Where can I find the configuration file for mysql?
 
Old 03-23-2007, 08:49 AM   #9
asommer
Member
 
Registered: Mar 2003
Location: North Carolina
Distribution: Gentoo
Posts: 168

Rep: Reputation: 30
I think you do need it to allow your applications to connect to it. There's probably a way to keep it local to the machine it's on though, but I've never set it up that way. With a little googling you should be able to find a configuration example to only allow connections from local processes.

The config file should be in:

Quote:
/etc/my.cnf
 
Old 04-16-2007, 03:53 AM   #10
gubak
Member
 
Registered: Jul 2004
Posts: 332

Original Poster
Rep: Reputation: 30
Hi!
I use CentOS 4.4, apache 2.0.52 webserver, php 4.3.9, mysql 4.1.
I have instaled mysql. If I type the command :
Code:
rpm -qa | grep mysql
It gives me:
Code:
mysql-server-4.1.20-1.RHEL4.1
mysql-devel-4.1.20-1.RHEL4.1
mysqlclient10-3.23.58-4.RHEL4.1
mysql-4.1.20-1.RHEL4.1
libdbi-dbd-mysql-0.6.5-10.RHEL4.1
Everithing seems to work fine except mysql. My website (pure php) is already on the apache and work.
For example if I open a page with the content (php info page) :
Code:
<? phpinfo(); ?>
The server gives me the php info page (http://www.coka.co.yu/proba.php).
But if I want to connect to mysql database, it gives me error.
For example:
Code:
	


    mysql_connect("localhost", "username", "password") 
    or die("Error" . mysql_error()); 
    mysql_select_db("database") 
    or die("Error" . mysql_error());  
	
$result=mysql_query("SELECT * FROM table where Name='$name' order by datum DESC") or die("Error:" . mysql_error()); 

$rekord = mysql_fetch_object($result);
echo $record->Column_name;
The error is:
Code:
Fatal error: Call to undefined function: mysql_connect()
 in /var/www/html/proba.php on line 4

If I try to connect to mysql database with wrong password, the result is the same.

On the server side mysqld is runing, the database is opened and the mysql port is open.


Can somebody help me?

Last edited by gubak; 04-16-2007 at 03:55 AM.
 
Old 04-16-2007, 08:31 AM   #11
asommer
Member
 
Registered: Mar 2003
Location: North Carolina
Distribution: Gentoo
Posts: 168

Rep: Reputation: 30
I don't think you have the PHP connector for MySQL installed.

Try:

Quote:
rpm -qa | grep php
You should have a package called:
Quote:
php-mysql-VERSION
installed. If not you can install it by:

Quote:
yum install php-mysql
I think that should get you going.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. NoviceW Linux - Networking 17 09-17-2014 03:13 PM
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock welery Linux - Software 19 03-06-2014 08:19 AM
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. suziecorbett Linux - Software 8 10-09-2008 02:52 AM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 09:44 AM
how do i Know Apache PHP MYSQL Installed on my Dedicated Server? phpsharma Linux - Newbie 3 04-18-2005 06:40 PM


All times are GMT -5. The time now is 10:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration