LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   general mysql questions (https://www.linuxquestions.org/questions/linux-software-2/general-mysql-questions-23402/)

niehls 06-14-2002 07:36 AM

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

aliensub 06-14-2002 09:10 AM

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/ )

ifm 06-14-2002 09:12 AM

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.

j-ray 06-17-2002 03:23 AM

it starts fine, but after that it seems to hang and nothing happens.

just open another bash window, itīs normal

ifm 06-17-2002 11:11 AM

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.


All times are GMT -5. The time now is 10:49 PM.