-
March 2nd, 2003, 05:56 PM
#1
Junior Member
PHP+Mysql
Hi.
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, 06:10 PM
#2
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, 06:14 PM
#3
Junior Member
thanks for your help anyway July
-
March 2nd, 2003, 07:33 PM
#4
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, 08:02 PM
#5
Junior Member
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, 08:19 PM
#6
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:
Code:
if [ -x /usr/local/bin/mysqld_safe ]; then
/usr/local/bin/mysqld_safe &
fi
Assuming mysqld_safe is in that directory. Otherwise, put the path to where the file is.
And lastly, I think you did this but not sure:
Code:
# cp mysql.server /etc/init.d/mysql
# cd /etc/inid.d
# chmod +x mysql
# cd /etc/rcx.d
# ln -s ../init.dmysql S99mysql
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.
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, 10:28 PM
#7
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, 02:29 AM
#8
Senior Member
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, 04:26 PM
#9
Junior Member
Thanks for your help boys..
-
March 3rd, 2003, 04:30 PM
#10
Originally posted here by neowarez
Thanks for your help boys..
Hrmph! I'm insulted! BOYS! What about us wimmen??
:P
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|