LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-28-2003, 03:04 PM   #1
techrolla
Member
 
Registered: Nov 2003
Distribution: Gentoo, Debian
Posts: 188

Rep: Reputation: 30
mysql with apache installation


I am using fedora, and I have installed the apache2 and mysql packages from the fedora CD's. I then updated mysql with an rpm to version 4.0.17. My problem is, is that it seems like apache 2 is starting its own session of mysql, but I can't do anything with it. I can't start up mysql or mysqld_safe or mysqld because it can't bind on TCP/IP port because its already in use, but I haven't started mysql my self, so I am wondering what is going on and if there is anyway I can use mysql like this. Thanks.
 
Old 12-28-2003, 06:34 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 235Reputation: 235Reputation: 235
Check and make sure your system didn't already have it installed and starting up at boot time. AFAIK, apache will not start mysql.
 
Old 12-28-2003, 07:28 PM   #3
techrolla
Member
 
Registered: Nov 2003
Distribution: Gentoo, Debian
Posts: 188

Original Poster
Rep: Reputation: 30
thanks, I checked out the services and it was selected. Now, how can I use it like any normal mysql installation? the mysql file is in /etc/init.d/ and all there is to it is start|restart|stop. How can I use this and create new databases? It seems to be setup differently than all of the installation help setups I've found online. i.e mysqld_safe and others installed from rpm's from mysql.com don't seem to work with it. Thanks.
 
Old 12-28-2003, 08:27 PM   #4
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 235Reputation: 235Reputation: 235
Well, that's just to start the database yes. To create new databases, etc you can install your initial one by doing: mysql_install_db

There are tons of commands with mysql, try typing mysql and before hitting enter, hit [tab] twice, it should display all the commands for mysql. Might want to get familiar with many of them to know what they do, etc.
 
Old 12-28-2003, 10:37 PM   #5
hypexr
Member
 
Registered: Oct 2003
Location: USA Fresno Callifornia
Distribution: Gentoo (workstation), ArchLinux (file/mail server), Freebsd (web server), Ubuntu (laptop)
Posts: 115

Rep: Reputation: 16
Try looking here for some very basic tips for using using mysql.

Also this is a good tutorial
 
Old 12-29-2003, 01:54 AM   #6
techrolla
Member
 
Registered: Nov 2003
Distribution: Gentoo, Debian
Posts: 188

Original Poster
Rep: Reputation: 30
Thanks for your help, but I am stuck. I found out from www.mysql.com that the file in /etc/init.d is the auto server start. I have been doing mysql_install_db, but I can't use mysqld_safe or /usr/sbin/mysqld. I can't seem to stop the /etc/init.d/mysql program, because it can't find a PID. Here is the terminal session I had:

Code:
[root@localhost max]# /etc/init.d/mysql stop
No mysqld pid file found. Looked for /var/lib/mysql/localhost.localdomain.pid.
[root@localhost max]# /usr/sbin/mysqld
031229  1:52:35  Can't start server: Bind on TCP/IP port: Address already in use031229  1:52:35  Do you already have another mysqld server running on port: 3306 ?
031229  1:52:35  Aborting
 
031229  1:52:35  /usr/sbin/mysqld: Shutdown Complete
 
[root@localhost max]# mysqladmin
bash: mysqladmin: command not found
[root@localhost max]#
That is after running mysql_install_db with no problems.

Any suggestions? thanks.
 
Old 12-29-2003, 02:12 AM   #7
hypexr
Member
 
Registered: Oct 2003
Location: USA Fresno Callifornia
Distribution: Gentoo (workstation), ArchLinux (file/mail server), Freebsd (web server), Ubuntu (laptop)
Posts: 115

Rep: Reputation: 16
First give your host a name other than localhost.
Next, you can see if the mysql deamon is running with the command "ps aux | grep mysql"
If you have a problem with it already running, meaning that right now you can not enter the mysql> prompt with something like "mysql -u root -p" then try killing the process/es.
If there are no processes but it still thinks that the mysql server is running then see if there is a mysql.pid file in /var/run or somewhere else that you can delete.
In the future to start it and stop it with the /etc/init.d/mysql script and don't worry about starting it from the /usr/sbin/mysqld or mysqld_safe.


to find if mysqladmin is on your drive somewhere try "which mysqladmin" this will probalby not work since if it exists the driectory containing it is does not seem to be in your path. So use find,
"find / -name mysqladmin -print"

Last edited by hypexr; 12-29-2003 at 02:13 AM.
 
Old 12-29-2003, 01:01 PM   #8
techrolla
Member
 
Registered: Nov 2003
Distribution: Gentoo, Debian
Posts: 188

Original Poster
Rep: Reputation: 30
with the ps aux | grep mysql, how do I know from the output what is currently running?? And changing the hostname, how is this done? I did hostname 'newhostname' and that seemed to change it when I did the hostname command, but it still says root and max@localhost. Also, for the mysqladmin, I forgot to install MySQL-client. Here is the output from the grep:

Code:
[root@localhost rpm]# ps aux | grep mysql
root      6608  0.0  0.2  5232  348 ?        S    Dec28   0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/localhost.localdomain.pid
mysql     6639  0.0  0.4 30708  568 ?        S    Dec28   0:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/localhost.localdomain.pid --skip-locking --socket=/var/lib/mysql/mysql.sock
mysql     6640  0.0  0.4 30708  572 ?        S    Dec28   0:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/localhost.localdomain.pid --skip-locking --socket=/var/lib/mysql/mysql.sock
mysql     6641  0.0  0.4 30708  572 ?        S    Dec28   0:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/localhost.localdomain.pid --skip-locking --socket=/var/lib/mysql/mysql.sock
mysql     6642  0.0  0.4 30708  572 ?        S    Dec28   0:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/localhost.localdomain.pid --skip-locking --socket=/var/lib/mysql/mysql.sock
mysql     6643  0.0  0.4 30708  572 ?        S    Dec28   0:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/localhost.localdomain.pid --skip-locking --socket=/var/lib/mysql/mysql.sock
mysql     6644  0.0  0.4 30708  572 ?        S    Dec28   0:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/localhost.localdomain.pid --skip-locking --socket=/var/lib/mysql/mysql.sock
mysql     6645  0.0  0.4 30708  572 ?        S    Dec28   0:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/localhost.localdomain.pid --skip-locking --socket=/var/lib/mysql/mysql.sock
mysql     6646  0.0  0.4 30708  572 ?        S    Dec28   0:02 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/localhost.localdomain.pid --skip-locking --socket=/var/lib/mysql/mysql.sock
mysql     6647  0.0  0.4 30708  572 ?        S    Dec28   0:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/localhost.localdomain.pid --skip-locking --socket=/var/lib/mysql/mysql.sock
mysql     6648  0.0  0.4 30708  572 ?        S    Dec28   0:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/localhost.localdomain.pid --skip-locking --socket=/var/lib/mysql/mysql.sock
root     21253  0.0  0.4  4968  584 pts/2    S    12:52   0:00 grep mysql
[root@localhost rpm]#
Edit: Wow, its a lot easier to read like that.

Last edited by techrolla; 12-29-2003 at 01:03 PM.
 
Old 12-29-2003, 06:39 PM   #9
hypexr
Member
 
Registered: Oct 2003
Location: USA Fresno Callifornia
Distribution: Gentoo (workstation), ArchLinux (file/mail server), Freebsd (web server), Ubuntu (laptop)
Posts: 115

Rep: Reputation: 16
So now you have access to mysqladmin? If so use it to set the password for mysql.
Code:
mysqladmin -u root password 'password_you_want'
since it appears that mysql deamon is already running this should work.
Then you can enter the mysql prompt with the command:
Code:
mysql -u root -p
Where you will then be asked for the password that you entered above.
Then you should see the mysql> prompt and be able to type commands. Refer to the links I posted above for tutorials and tips for doing so.
 
Old 12-30-2003, 02:55 PM   #10
techrolla
Member
 
Registered: Nov 2003
Distribution: Gentoo, Debian
Posts: 188

Original Poster
Rep: Reputation: 30
thank you so much. The funny thing about it is that I have gotten to the mysql promp and everything before, but then I forgot. I should write this stuff down. thanks.
 
Old 12-30-2003, 10:34 PM   #11
hypexr
Member
 
Registered: Oct 2003
Location: USA Fresno Callifornia
Distribution: Gentoo (workstation), ArchLinux (file/mail server), Freebsd (web server), Ubuntu (laptop)
Posts: 115

Rep: Reputation: 16
Cool deal. Yeah I had everything set up once... and went back a year later to do pretty much the same thing and had big problems. The second time I did decide to write it all down.
 
Old 12-30-2003, 11:58 PM   #12
techrolla
Member
 
Registered: Nov 2003
Distribution: Gentoo, Debian
Posts: 188

Original Poster
Rep: Reputation: 30
heh, thats what I'm going to do now. You know the funny thing is that you actually helped me with 2 things....getting mysql working and you gave me your site on phpbb, which was the main reason I was trying to get mysql to work, so good job and thanks for that, phpbb is now up and running!
 
  


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
Apache Perl Mysql installation problems ridge321 Linux - Newbie 1 02-15-2005 08:49 AM
Integrating PHP and MySQL Into Apache From Full Installation tsuehpsyde Fedora 11 05-05-2004 02:15 PM
Order of installation Apache, Mysql, PHP,SSH piratebiter Linux - Newbie 3 08-16-2003 02:13 PM
Installation Tutorial Apache 2, PHP 4, MySQL 3.23 freddymio Programming 2 07-03-2002 09:40 AM
installation of Jakarta, MySQL, Apache spechtacular Linux - Software 0 06-08-2001 10:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:12 PM.

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