xutoa
01-08-2002, 01:51 AM
i got a msg"Can't connect local MYSQL server through 'tmp/mysql.sock(2)'while accessing a php file contains"$link=mysql_connect("localhost","root");"
y?
Regards.
y?
Regards.
|
Click to See Complete Forum and Search --> : about mysql xutoa 01-08-2002, 01:51 AM i got a msg"Can't connect local MYSQL server through 'tmp/mysql.sock(2)'while accessing a php file contains"$link=mysql_connect("localhost","root");" y? Regards. furrycat 01-09-2002, 02:08 AM Is the MySQL daemon running? If it is, does the Unix socket mysql.sock exist in /tmp? If it is, you may need to set a password in the mysql_connect() function. Running the daemon without a root password is a bad idea anyway, as it connecting to it as root. If you're using Red Hat you might find they've done their usual trick of moving it somewhere else. Assuming the server is running, try "mysqladmin variables | grep socket" to find it. You can then either modify the mysql_connect() call (see PHP documentation) or start the server with the usual /tmp path by adding the --socket=/tmp/mysql.sock to your mysqld startup line. mandrake 01-23-2002, 12:33 PM Thank you xutoa. Although I cannot solve your problem, you have helped me to figure something out. I used the connection string you have (to log in as root) and this is working for me. Before I was getting an error because I was trying to log in using a username a username and password for logging on to linux. I guess I don't know how to create users in my sql. Can someone help me out with that? Thanks. furrycat 01-23-2002, 09:45 PM As the MySQL root user: "grant $BLABLABLA on $DB.$TABLE to $USER@localhost identified by '$PASSWORD';" where $BLABLABLA is "insert,delete,select" or some list of SQL commands you want the user to be able to run, $DB.$TABLE is the name of the database and table the user can access (either can be * meaning all) and $USER/$PASSWORD should be obvious. Example: read-only (select-only) access to the table "fruit" in the "food" database for the user "fish" with no password: grant select on food.fruit to fish@localhost; An admin user that can insert, change and delete entries in all tables in the "food" database: grant select,insert,update,delete on food.* to admin@localhost identified by 'adminpass'; A new root user (you 99% certainly don't need this): "grant all privileges on *.* to r00t@localhost identified by 'l33tp4ss'; And much more. The MySQL privilege system is very powerful. Read the manual... PS you can allow access from other hosts by replacing the @localhost as appropriate. Be advised though that if you use a DNS name you must make sure that the reverse lookup matches. mandrake 01-25-2002, 08:36 PM furrycat, Thanks for the assistance. I could not find information on www.mysql.com (http://www.mysql.com) in the documentation. This worked great. justlinux.com
Copyright Internet.com Inc. All Rights Reserved. |