473,809 Members | 2,876 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

new to mysql. 2 questions

Hi All,
I am new to mySQL and I have 2 questions:

1. Everytime I login to mySQL:

machine 21:06:32 ~ $ mysql -u root -p
Enter password:

It asks me for password. Since I didn't set a password for root when I
installed mySQL, I can just hit Enter and I will be login. This seems
silly so is there a way to disable the prompt so I am automatically
login without hitting Enter?

2. I want to create a user account with only SELECT privilege from
everywhere (like from other hosts). How can I do that? Will the
following work:

GRANT SELECT PRIVILEGES ON mydb.* TO 'readonly'@'*' IDENTIFIED by
'password'

Do I need to create the 'readonly' user first? Or will the above
automatically create the 'readonly' user if it does not already
exists?

Thanks!
Jul 20 '05 #1
2 1463


pembed2003 wrote:
Hi All,
I am new to mySQL and I have 2 questions:

1. Everytime I login to mySQL:

machine 21:06:32 ~ $ mysql -u root -p
Enter password:

It asks me for password. Since I didn't set a password for root when I
installed mySQL, I can just hit Enter and I will be login. This seems
silly so is there a way to disable the prompt so I am automatically
login without hitting Enter?


you can give your password also in command line, but i think you have to
have the password set

$ mysql --user root --password=mysql --database=dbase $*

--
pekka

Outoa, kaikki älykkäät ihmiset ovat samaa mieltä kanssani.

Jul 20 '05 #2
pembed2003 wrote:
machine 21:06:32 ~ $ mysql -u root -p
Try this:
machine 21:06:32 ~ $ mysql -u root
2. I want to create a user account with only SELECT privilege from
everywhere (like from other hosts). How can I do that? Will the
following work:

GRANT SELECT PRIVILEGES ON mydb.* TO 'readonly'@'*' IDENTIFIED by
'password'
Looks correct, except the username and address should look like this:
'readonly'@'%'
Do I need to create the 'readonly' user first? Or will the above
automatically create the 'readonly' user if it does not already
exists?


Yes, it will create the user also.
Jul 20 '05 #3

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

Similar topics

2
2358
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 PHP. Granted, with the right knowledge these potential threats can be avoided. But I've just...
1
5719
by: GTF | last post by:
PHP Web Survey Idea.. I have been given an opportunity to create a web based survey. This is a fairly lengthy survey of 60 pages on paper (various multiple choice and free form). These are the Requirements: -Provide a web interface to a database -Database stores the data (duh), but the capacity to extract the data
4
5308
by: Chris | last post by:
Hi, sorry to post OT but i cant find the MySQL newsgroup, however i am hoping to pick up on some expert advice from php/mysql gurus here. I'm having some trouble performing a delete across two tables. The tables i have are: questionnaires (id, name); questionnaire_questions (questionnaires_id, id, name, qf_type)
0
1360
by: Harald Falkenberg | last post by:
Hi, I'm new to mysql. Coming from the oracle database a couple of questions came up. Perhaps somebody, who has also experience in oracle, can set me on the tracks. Questions: 1. is mysql simular organized as oracle: instance/users/tables, so that I have to connect to chossen instance and user?
175
11527
by: Sai Hertz And Control Systems | last post by:
Dear all, Their was a huge rore about MySQL recently for something in java functions now theirs one more http://www.mysql.com/doc/en/News-5.0.x.html Does this concern anyone. What I think is PostgreSQL would have less USP's (Uniqe Selling Points
3
2444
by: Try Kret | last post by:
Hello, Any good documents on how to connect and manipulate data stored in MySQL. Faithfully yours, Try.
1
1593
by: E.T. Grey | last post by:
Hi All, Despite spending the past six to seven hours perusing the docs on the mySQl site, I still have questions unanswered, and have been unable to get any help. I am familiar with Sybase, some Oracle and PostgreSQL - but the mySQL SQL seems a bit "non-standard". I would be very grateful for any help I get in answering these questions: Stored procedures
0
1755
by: Sam Flywheel | last post by:
Hello, all: I am pleased to announce that the MySQL Journal is moving forward. During the past two weeks, I've been discussing the journal with MySQL AB, and the plan that's been devised benefits all involved, including authors, readers, the community, and MySQL AB.  Let me outline how the journal will operate: * The name of the magazine is Tabula: The Journal of MySQL Development.
10
1487
by: bill | last post by:
I have a database of kennels. One page lists the kennels alphabetically by kennel name. I have a field for kennel name and an index with kennel name as the only field. Some of the kennels have the word "The" as the first word in the name and they do not want to be listed alphabetically by "The..." Is there a way that I can request that mysql ignore "The" in a kennel name when ordering it or must I create a new field for the
27
3922
by: gerrymcc | last post by:
Hello, I'm a php/mysql beginner... Is there any way of making the mysql command line client full-screen? Sometimes it's easier to use the client than go thru php, but since it's only about 80 characters wide that limits its usefulness. Thanks, Gerard http://homepage.eircom.net/~gerfmcc]
0
9721
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9600
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10633
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10376
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10375
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
5548
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5686
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3860
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3011
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.