mysql access denied for user
[1/7] from: ryan:christiansen:intellisol at: 19-Mar-2001 15:57
I'm trying to access a database using the mysql scheme, but the server is telling me access is denied for "[username--domain--com]" when I am only logging in using "username," not "[username--domain--dom]." What am I doing wrong? For example.
>> db: open mysql://username:[password--0--0--0--0]/database
connecting to: 0.0.0.0 ** User Error: ERROR 1045 : Access denied for user: ['username--domain--dom'] (Using password: YES). ** Where: db: open mysql://username:[password--0--0--0--0]/database
I'm able to login OK via telnet with the same username/password. Ryan C. Christiansen Web Developer Intellisol International 4733 Amber Valley Parkway Fargo, ND 58104 701-235-3390 ext. 6671 FAX: 701-235-9940 http://www.intellisol.com Global Leader in People Performance Software _____________________________________ Confidentiality Notice This message may contain privileged and confidential information. If you think, for any reason, that this message may have been addressed to you in error, you must not disseminate, copy or take any action in reliance on it, and we would ask you to notify us immediately by return email to [ryan--christiansen--intellisol--com]
[2/7] from: kracik:mbox:dkm:cz at: 20-Mar-2001 0:01
Hi Ryan, This is normal, MySQL always distinguishes user names with domains. When you login with telnet to the server running MySQL, you run MySQL client and server on the same machine. MySQL server recognizes you as [user--localhost] which is granted access by default. But all users in other domains are denied access, and you (or server's administrator) must first grant them access manually. Look here: http://mysql.com/documentation/mysql/bychapter/manual_Privilege_system.html It was not easy for me to understand and set up. -- Michal Kracik [ryan--christiansen--intellisol--com] wrote:
[3/7] from: norsepower:uswest at: 19-Mar-2001 18:07
So does that mean the mysql:// protocol will only work using scripts executed on the server where the database resides?
[4/7] from: kracik:mbox:dkm:cz at: 20-Mar-2001 10:31
> So does that mean the mysql:// protocol will only work using scripts > executed on the server where the database resides? >
With default MySQL privileges, yes. It's not specific to mysql:// protocol, it's the same with PHP, Perl, ODBC driver or any other client. But MySQL administrator can grant access to specific or all users, domains or IP addresses. I tried it with Nenad when testing the mysql:// protocol and it worked. But it took some time to set up the privileges, and I don't remember the exact commands. This should allow connection and grant all privileges to all databases to user with name rebtest and password reb from any domain. It's good for testing, but it's insecure since it allows the user to accidentally delete all databases on the server. telnet as any user shell> mysql -uroot -p The only MySQL user with administrative rights is root by default. His password is by default empty, it's different from root's UNIX password. mysql> use mysql; mysql> GRANT ALL PRIVILEGES ON *.* TO rebol@"%" IDENTIFIED BY 'reb'; mysql> quit; Hope this helps, -- Michal Kracik
[5/7] from: norsepower:uswest at: 20-Mar-2001 7:37
Thanks for pointing me in the right direction. I found it here in the docs... shell> mysql --user=root mysql mysql> GRANT ALL PRIVILEGES ON *.* TO [monty--localhost] IDENTIFIED BY 'some_pass' WITH GRANT OPTION; mysql> GRANT ALL PRIVILEGES ON *.* TO monty@"%" IDENTIFIED BY 'some_pass' WITH GRANT OPTION; A full superuser who can connect to the server from anywhere, but who must use a password 'some_pass' to do so. Note that we must issue GRANT statements for both [monty--localhost] and monty@"%". If we don't add the entry with localhost, the anonymous user entry for localhost that is created by mysql_install_db will take precedence when we connect from the local host, because it has a more specific Host field value and thus comes earlier in the user table sort order.
[6/7] from: assembly:whiterose at: 21-Mar-2001 13:47
Im sorry to do this but could someone repost the link to the mysql:// port scheme. For some reason it appears I removed my message on it. Brady On Tue, Mar 20, 2001 at 07:37:27AM -0600, <[norsepower--uswest--net]> wrote:
[7/7] from: gjones05:mail:orion at: 21-Mar-2001 13:19
From: Frontline Assembly
> Im sorry to do this but could someone repost the link to the mysql:// port
scheme. For some reason it appears I removed my message on it.
http://rebol.dhs.org/mysql-loader.r at DocKimbel's site --Scott Jones