LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 06-14-2002, 07:36 AM   #1
niehls
Member
 
Registered: Jun 2002
Location: Sweden
Distribution: slack, redhat
Posts: 91

Rep: Reputation: 15
general mysql questions


i know this is extremely newbyish, but i have several questions concerning mysql.
i am programming php and in order to use mysql i downloaded the most recent rpm from mysql.com.
istalled it, and everything looks fine.
my problem is that i have absolutely no idea how to get to the mysql prompt or anything. ps says that safe_mysqld is running.
i didn't know how to shut it off, so i removed all rights on mysql in /etc/rc.d/init.d and rebooted my computer. after that i tried:
safe_mysqld -u root create newdb
it starts fine, but after that it seems to hang and nothing happens.
i searched through mysql tutorial, but there is only information on how to install it and how to use it. not how to run it or how to get to the console.

read on php.net that php has a built in support for mysql. does this mean i do not need mysql installed, or does it just mean i do not have to include it when compiling?
i use RedHat 7.2 if that is of any interest.
any help is appreciated.
//
Kristian
 
Old 06-14-2002, 09:10 AM   #2
aliensub
Member
 
Registered: Apr 2002
Location: Denmark
Distribution: OS X
Posts: 306

Rep: Reputation: 30
You need to have mysql installed, and you ned the module_mysql for php (i mean itīs there in a default redhat install with php). A good administrationtool for mysql is phpmyadmin (canīt remember where to get it) or webmin which is a admin tool for many parts of linux including mysql ( http://www.webmin.com/ )
 
Old 06-14-2002, 09:12 AM   #3
ifm
Member
 
Registered: Jun 2002
Location: USA
Distribution: RH7.3 & YDL2.1
Posts: 124

Rep: Reputation: 15
Talking Yummy MySQL

You don't need to turn off 'safe' running. Thats the deamon that controls the mysql database on your machine. It might actually be a bad thing that you killed that /etc/rc.d/init.d file... as it starts up your mysql for you when the machine is booted (starts it up correctly too, and also creates the initial database you need to control mysql users and premissions).

Each time you connect to mysql (either personally, or with php, or anything else) a new spawned "mysqld" will show up in the 'ps' list.

To connect through command line, just simply type "mysql". Although you used an RPM right? You might have to find where it install mysql, and type the full path to it to run it. Could be like "/usr/local/mysql/bin/mysql" to run it.

Once it runs, you are in mysql command line. You can type things like "create database _newdbname_" or "use _dbname_"... and any other sql commands you like. Make tables, add columns, edit them etc etc etc.

Other commans for MySQL are the "mysqladmin" tool. This lets you do direct fast commands, and also show the status of mysql running. Also lets you view all the settings and variables its running with. Very helpful. (again this might be burried in wherever the rpm installed it).


"read on php.net that php has a built in support for mysql. does this mean i do not need mysql installed, or does it just mean i do not have to include it when compiling?"

It does, and doesn't My PHP on three of my machines all used an internal library for compiling with MySQL (--with-mysql). However on RH7.3, when it installed PHP with mysql, it actually linked OUT (external) to libraries for MySQL... which was a first for me, and I was flabergasted =) I was never able to externally link to mysql libraries before when installing php.


If I didnt answer you question, please respond, and I will help. I have had much experience with installing both mysql and php, and should be able to help =) But then again ... every computer is different, hehee... and I admit I have never used an RPM for either... so ... I could be blowing smoke.


Oh, and NO, you DO need to have MySQL installed in order to have PHP use it. The "built in support" in regards to PHP just means it has its own libraries for use for mysql. However you still need mysql installed AND running in deamon mode in order for php to talk to it.

Last edited by ifm; 06-14-2002 at 09:17 AM.
 
Old 06-17-2002, 03:23 AM   #4
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
it starts fine, but after that it seems to hang and nothing happens.

just open another bash window, itīs normal
 
Old 06-17-2002, 11:11 AM   #5
ifm
Member
 
Registered: Jun 2002
Location: USA
Distribution: RH7.3 & YDL2.1
Posts: 124

Rep: Reputation: 15
Oh... right.

You are starting it on command line manually. Which normally is a bad idea if you want to have it run as a service deamon.

Since you are starting it manually, it of course is going to appear hung until you cntrl-c out...

You need to start it up as a deamon, and that is what the /etc/rc.d/init.d/mysqld [start|stop|restart|status] command is for.
 
  


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
3 General Questions AndrewZorn Linux - Newbie 4 04-02-2005 10:09 PM
General Questions gcobb Linux - Software 2 10-21-2004 12:09 AM
mysql general problem alaios Linux - General 1 09-25-2004 09:16 AM
general questions saiz66 Slackware 2 04-27-2003 11:44 PM
general questions [cacheflow] Linux - Newbie 4 01-25-2002 07:01 PM

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

All times are GMT -5. The time now is 05:06 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
Open Source Consulting | Domain Registration