LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Do I have mysql server installed? (https://www.linuxquestions.org/questions/linux-newbie-8/do-i-have-mysql-server-installed-539279/)

gubak 03-21-2007 05:57 AM

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?

remargorp 03-21-2007 06:04 AM

You can try:
Code:

$ locate mysql
Or (as root)...
Code:

# find / -name mysql -print
Hope that helps!

gubak 03-21-2007 07:32 AM

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

asommer 03-21-2007 07:44 AM

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

gubak 03-21-2007 07:54 AM

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

reddazz 03-21-2007 08:07 AM

I think you only have the client installed. If you had the server installed, a package called "mysql-server" would be in that list.

asommer 03-21-2007 08:33 AM

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

Quote:

yum install mysql-server

gubak 03-23-2007 01:46 AM

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?

asommer 03-23-2007 07:49 AM

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

gubak 04-16-2007 02:53 AM

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?

asommer 04-16-2007 07:31 AM

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.


All times are GMT -5. The time now is 05:13 PM.