March 2nd, 2003, 04:56 PM
Well I have 2 litlle problems with mysql and php and I think that someone here can help me.
So my 1st problem is how can I make mysqld start at boot time. I ask this because I copy the mysql.server file to the /etc/init.d/ and it doesnt run anyway.
The 2nd problem is a php script that return me this error: "Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/esab/public_html/includes/news.php on line 16" and I know that the code of php is rigth because on other box it runs well..
Thanks and sorry about my english
March 2nd, 2003, 05:10 PM
Not sure about your mysql problem but on php I get that alot because I dont' have the correct table names or field names in the query. Make sure your spelling it right or add a or die statement so you can see a more detailed error
March 2nd, 2003, 05:14 PM
thanks for your help anyway July
March 2nd, 2003, 06:33 PM
Could you post the code you are having the problem on? It might help.
Also what version of PHP are you running on this box versus the other box? What distro are you running? Depending on the distro, there are some simple commands to have MySQL startup automatically.
MySQL Manual gives some basic startup script hints.
March 2nd, 2003, 07:02 PM
well I already resolved the 2nd problem ..its a stupid problem with mysqld.. (database) ..
MsMittens the distro on the box is red hat 7.3..
I read the Mysql manual and it tell to copy support-files/mysql.server to the startup place ..
I think that this startup place is /etc/init.d/ but it doesnt run anyway.. because the command to use is "msyql.server start|stop" .. I already change the source so it only be needed to use "mysql.server" so it run as "msyql.server start" but it doesnt work too...
Do you know what's the problem?
March 2nd, 2003, 07:19 PM
You rebooted the machine after you copied to the file to see if it started up?
You can also add the mysql to the chkconfig e.g., chkconfig --add mysql.server
You can also add the following to the rc.local file:
Assuming mysqld_safe is in that directory. Otherwise, put the path to where the file is.
if [ -x /usr/local/bin/mysqld_safe ]; then
And lastly, I think you did this but not sure:
Where x is a runlevel, # is the root prompt and S99 is a startup script number. This can be the next available big number. The numbers indicate the order in which things are started. A database is best left to the end so even sticking it in a three-digit startup would be good.
# cp mysql.server /etc/init.d/mysql
# cd /etc/inid.d
# chmod +x mysql
# cd /etc/rcx.d
# ln -s ../init.dmysql S99mysql
Script information was retreived from MySQL: The definitive guide to using, programming, and administering MySQL 4, 2nd Edition by Paul DuBois. It's well worth it for those who are curious.
March 2nd, 2003, 09:28 PM
have yo tried this?? go to /etc/rc.d vi rc.local put this line in. /etc/rc.d/init.d/mysqld start or whatever you called you init script that should start the server at boot.
March 3rd, 2003, 01:29 AM
Hope this helps: I am using Red Hat 8.0 with postgreSQL, but maybe similar config can be used for mysql. Using gnome, go to: server settings ---> services makesure there is a check mark in httpd and mysqld, right click on mysqld and chose restart service, or just restart the whole system. This works for rh 8.0 but i am sure something similar will work for 7.3.
March 3rd, 2003, 03:26 PM
Thanks for your help boys..
March 3rd, 2003, 03:30 PM
Hrmph! I'm insulted! BOYS! What about us wimmen??
Originally posted here by neowarez
Thanks for your help boys..