Gossamer Forum
Home : Products : Others : MySQLMan :

Can't login to MySQL, and CGI Errors

Quote Reply
Can't login to MySQL, and CGI Errors
I'm new to MySQL but have learned quite a bit in the last week. I am trying to get MysqlMan working but it keeps saying "Could not login to MySQL". I've tried many different login combinations, none of which seem to work. I am on a virtual server running BSD/OS. MySQL version is 3.22.25. When I telnet to the server, I can log into MySQL with the 'root' user using the password I set. If I do a 'status' in mysql, it says "Current user: root@localhost". Doesn't this mean that my host is 'localhost'? If so, in MysqlMan I type in:
Host: localhost
User: root
Password: ***** (my password)
This should work...right?

Here is the top part of mysql.cfg:
-------------------------------
# Auto Set the current path.
BEGIN {
use vars qw/$script_path/;
# $0 =~ m,(.*?)[^/\\]+$, ? ($script_path = $1) : ($script_path = '.');
$script_path="/usr/local/etc/httpd/cgi-bin/mysqlman";
}

# --------------------------
# CONFIG HASH |
# --------------------------

%config = (

# FILES
# --------------------------------------------------------
# the url to support.cgi. No Trailing Slash Please.
script_url => "mysql.cgi",
home_url => "http://www.thefew.com",
template_dir => $script_path . "/templates",
...
...and the rest of it...
...
------End mysql.cfg


I also noticed that I have my home_url set to http://www.thefew.com, yet when I try to login, the URL in the location bar of netscape changes to http://thefew.safepages.com. Safepages is my virtual server host, and I can get to my site by typing: www.thefew.com, thefew.com, or thefew.safepages.com.

One other thing is that I have MysqlMan 1.0. I've downloaded it again yesterday, but after unzipping it, the script is still version 1.0, not 1.01.

I just purchased the DBManSQL script (should get it in about 2 days), but if I can't get MysqlMan to work and interface with MySQL, how the heck am I supposed to get DBManSQL to work!

If anyone can help I'd greatly appreciate it. I'm very fluent in Perl/CGI...MySQL is not my forte...yet!
You can see the script at http://www.thefew.com/cgi-bin/mysqlman/mysql.cgi

Thanks,
AJ
Quote Reply
Re: Can't login to MySQL, and CGI Errors In reply to
Two things. I don't like the fact that you are being redirected, since once you are redirected, the "host" changes to the Browser and to the Server.

You might want to set the program url to http://thefew.safepages.com, just to (literally) make sure you are on the "same page".

Then, you would want to ask your ISP what the name of the server is. "localhost" might work via telnet, but it might not work when the server is passing the commands through, "localhost" could be ambiguous to the MySQL server.

If neither of those two things make a difference, how about posting the error message exactly?

Also, I've had better luck when I've hard-coded the %config hash values, with full URL and full path information. It only makes 4 variables to change -- the



Code:
$script_path at the top of the file (just hard code it AFTER the
auto-set and you don't have worry about commenting out
anything)

and the 3 fields of the %config hash:

%config = (

# FILES
# --------------------------------------------------------
# the url to support.cgi. No Trailing Slash Please.
script_url => "mysql.cgi",
home_url => "http://www.thefew.com",
template_dir => $script_path . "/templates",



Make it



%config = (

# FILES
# --------------------------------------------------------
# the url to support.cgi. No Trailing Slash Please.
script_url => "http://www.myserver.com/cgi-bin/path/to/mysql.cgi",
home_url => "http://www.thefew.com",
template_dir => "/full/path/to/the/templates",





http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/

Quote Reply
Re: Can't login to MySQL, and CGI Errors In reply to
Thanks pugdog for responding. I know this is a long message but bear with me. I want to explain in detail what's happening...

I did what you suggested and it didn't make a difference. BUT, I have figured out a few things and I have got a bit further. First, I got rid of most of the redirection to thefew.safepages.com by editing my httpd.conf file. It had the base reference as thefew.safepages.com so I changed it to www.thefew.com. It still redirects to thefew.safepages.com occasionally (not sure why). I also figured out that I hadn't created any users for MySQL with the GRANT command. When I tried to add a test user last night with the 'root' user, it kept giving me an 'Access denied on root@localhost'. So this morning, I shutdown MySQL, wiped out all traces of it on my server, then reinstalled it. Tada, I can now add users...

OK, so I have created a test user for test@localhost and test@"%". In MysqlMan, if I use host: localhost, I get the same error I was before 'Can't connect to MySQL'. But if I use host: thefew.com it looks like it is trying to find the list of databases that exist, but It then gives me a '500 Internal Server Error'. I haven't made any mods to the MysqlMan script except the hardcoding of the script location in the .cfg file. I then came back to here to the support forum and read the post called 'The first mod to the script?' by JPDeni. In it, steven_chen responded with a direct link to view the tables. I copied it and modified it with host=thefew.com and the test username and password. It worked great! I can create db's and tables. BUT when I click the 'Databases: List' link I get the '500 Internal Server Error'. It's the only link I get it on. I can create a db, create tables in the db with fields. The only thing I can't do is view the list of databases FROM THE LINK! Now here's the kicker...if I click on Databases: Create, I can create a database. THEN it brings me to the screen that says 'New Database (dbname here) Created' and shows me the list of all the databases below the message with the option to click on a database name or drop it!!!!! Below is what is recorded in the error log if I try to enter MysqlMan through the login screen. Any ideas pugdog...or anyone?

--------Error_log----------
[Thu Jun 1 11:50:54 2000] mysql.cgi: (28886): Connecting dbi:mysql:host=thefew.com ..
[Thu Jun 1 11:50:54 2000] access to /usr/local/etc/httpd/cgi-bin/mysqlman/mysql.cgi failed for 158.96.252.48, reason: Premature end of script headers
--------------------------

Also, I downloaded MysqlMan again a few minutes ago and the README.TXT says it is v1.01! So I tried this version just now and does the same things I mention above. I don't mind going in the 'back' way by a direct link. I'm just wondering if there is still a configuration issue with the MySQL loaded on my server or if it's MysqlMan?!?

Thanks,
AJ

Quote Reply
Re: Can't login to MySQL, and CGI Errors In reply to
It might a configuration issue, because if it works one way, but not another, it's not doing the right thing all the time.

On the other hand, because cookies are required.... if you are using MSIE it might be a cookie problem.

If you are not using MSIE, then it's probably in the code. If you are using MSIE, try using Netscape and see if the same things happen.

http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/