473,563 Members | 2,703 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

newb probs w/ user accts

Newb here! Using 4.0.20 on Slack. Slogging through the official
manual. At 2.4.3 Securing the Initial MySQL Accounts, I'm finally
stopped cold while trying to follow instructions. Here's what I did:

shell> mysql -u root
mysql> SET PASSWORD FOR ''@'localhost' = PASSWORD('newpw d');

.....as per instructed (I just cut 'n paste). I then quit mysql and
log back on as root:

mysql -u root

.....expecting a passwd prompt. Nothing. I just go in as root, as
confirmed by:

mysql> select user();
+----------------+
| user() |
+----------------+
| root@localhost |
+----------------+

So, about syntax, are all those single quotes suppose to be in the
actual command? Also, since I've done this (and nothing else), I can
no longer log in as anonymous. I get:

notbob ~>mysql
ERROR 1045: Access denied for user: 'notbob@localho st' (Using
password: NO)

Everything was going along so well. What happened?

nb
Jul 23 '05 #1
1 1545
notbob wrote:
mysql> SET PASSWORD FOR ''@'localhost' = PASSWORD('newpw d');

....as per instructed (I just cut 'n paste). I then quit mysql and
log back on as root:

mysql -u root

....expecting a passwd prompt. Nothing.
You won't see a password prompt unless you also use the -p option. The
same username can be configured to log in using a password or without
using a password.

This is done so that you could, for example, configure a different set
of privileges for the same user, depending on whether they provide the
password, or log in without giving a password. You could even have the
same user log in with one of several passwords, and grant different
privileges depending on which password they use.

MySQL has great flexibility with their privilege system. So flexible
that it's probably very confusing to keep track of all the
configurations one might set up.
So, about syntax, are all those single quotes suppose to be in the
actual command?
Yes, they are.
notbob ~>mysql
ERROR 1045: Access denied for user: 'notbob@localho st' (Using
password: NO)


Again, you need to use the -p option to let mysql know that you are
attempting to log in using a password.

Without the -p option, you have told it to give you the privileges
granted to the anonymous login when no password is given. That's a
legitimate situation, since you might have deliberately granted a
special set of limited privileges in that case.
For example:
$ mysql -u root
mysql> grant all on test.* to ''@'localhost' identified by '';
mysql> quit;
$ mysql test
(no denial of connection, and no password prompt)

But since you changed the anonymous user's password to 'newpwd', and
didn't issue a specific grant to the anonymous user when not using a
password, this has effectively denied all access when you don't use a
password. No connection will work when not specifying a password.
That's probably what is desired, according to the MySQL setup
instructions -- to disable all non-passworded access, for all databases.

So try logging in thus:

mysql -p

Then type your newpwd at the prompt.

Regards,
Bill K.
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2346
by: Xizor | last post by:
Ok, I'm new to PHP and MySQL. I've been going through tutorials, reading the documentation, and looking through web sites. PHP to me seems great! With MySQL it seems even better. However, I'm an experienced C++ programmer. This has allowed me to see many potential areas where the security of a server can be compromised through loopholes in...
3
6530
by: Sean Berry | last post by:
Hi there. I am relativly new to Python CGI and need a question answered. I have made custom 404 error pages and have them in various web directories. I have not been able to figure out a way to have apache use a file not within it's own home directory, so I was going to have a .py file in cgi-bin forward the user on to the correct error...
1
1970
by: Arijit Chatterjee | last post by:
Hi Everybody, I am facing another probs. I have created a trigger for table Tab1 for perticular column col1 for checking value ranges.But at time for using insert statement it is working fine but when I am importing data from flat file through DTS the trigger is not working.How to solve this. Regards Arijit Chatterjee
2
2265
by: jim | last post by:
I'm trying to find the best way to allow web visitors to download text files (.txt, .wri & .zap file extensions). I'm having some luck. I say some because the open/save box opens with IE but not Netscape. On Netscape rather than give the user the save option it simply displays the file. I also see problems on the mac platform - no save box -...
12
5001
by: Mikejacko86 | last post by:
Hello everyone! I have decided to convert over my table-based layout to pure CSS, to reduce filesize and to increase my designs flexibility. Apparently, I have run into quite a few problems. I wrote the code and tested it in IE (6), but it looks awful in Mozilla (firefox). Im quite sure my problems are basic, as there really isnt much...
20
2018
by: Chad Everett | last post by:
Hi all, I am new to the group. Trying to learn Python programming on my own. I am working through Michael Dawson's Book Python Programming for the absolute beginner. I am tring to write a program that is a number guessing game. I want to be able to give the user 5 tries to guess the number before the program ends. I get the result...
24
2329
by: Apotheosis | last post by:
The problem professor gave us is: Write a program which reads two integer values. If the first is less than the second, print the message "up". If the second is less than the first, print the message "down" If the numbers are equal, print the message "equal" If there is an error reading the data, print a message containing the word "Error"...
3
1757
by: Mukesh | last post by:
HI all I have created a user ctrl for user info. On which i have used some asp ctrls, .net Ajax (Atlas) Ctrls and validation as described below Name TxtBox1(RequiedFieldValidator, RagexValidetor) Email TxtBox2(RequiedFieldValidator, RagexValidetor) Mobile Txtbox3(RagexValidetor)
8
2855
by: sabby | last post by:
I want to use the getline() so that i can enter a entire name in on line. (with spaces) The prob is that i am initializing the variable as "N/A" and saving it to a text file. it is declared as a string. look at the code: #include <iostream.h> #include <fstream> #include <cstdlib> #include <string> using namespace std; //Account data...
0
7580
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8103
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7634
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7945
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6244
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5481
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3634
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3618
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1194
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.