|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Questions: users, insert, tips/advice
In MySQL I'm trying to create a user that I will be using for access to the database when someone visits the site and uses the search function but I cannot get it to work.
Here is what I insert into MySQL: Code:
grant all
on *
to admin identified by 'my_password'
with grant option;
when I execute that command here is what I get: Code:
ERROR 1044: Access denied for user: '@localhost' to database 'engineering' I've searched the forum for similar problems and came across a couple, but the solutions to their problems didn't help any. Also I am seeking advice on how to build my database so that it is most effective. I have close to 35 pages of content on our company website and it all needs to be searchable. That is not including pages that I will have to include for each individual product. Now would you guys build a table for each individual page? That is the way I'm leaning towards doing it. Then in each table I plan on having it search a .txt file to get the content for the value fields that will be displayed. Each table will have the values of page and/or product id#, text (all the text describing the item or the text on that particular page), and then a link field that contains the link to that page, and possibly a date added field. I would like to build my first database efficiently so that I do not get into the habit of using unwise methods. Any advice would be appreciated in this regard. I had a question regarding the insert command but I seem to have forgotten it. If I remember I will post again in this thread. My apologies for being so long winded in this post. But thanks for the help! The Squirrel |
|
#2
|
|||
|
|||
|
RE: Questions: users, insert, tips/advice
I'm not sure I follow what you're doing. If you just need a search function for a small site(35 pages), you could look into ht://Dig (*nix).
The command you're trying to use is for the DB admin to grant others access to certain DBs or tables with a specific set of permissions. This would have nothing to do with someone browsing you're website. |
|
#3
|
|||
|
|||
|
RE: RE: Questions: users, insert, tips/advice
Quote:
In order to access the DB to run a search query of the site you must define a username and password in order to open the DB and then the query will take place, and then return the results back to the site. I could just leave that part empty and it will default to the default username and password for MySQL and access it, but I feel more comfortable selecting a specific user that can access it. I'll check out that link you gave and see if that is what I need. Thanks! The Squirrel |
|
#4
|
|||
|
|||
|
RE: Questions: users, insert, tips/advice
Sorry for the misunderstanding.
You're statement should be fine. How are you issuing this command? The error would suggest that you aren't even connecting to the database server due to not specifying a username. |
|
#5
|
||||||
|
||||||
|
RE: RE: Questions: users, insert, tips/advice
Quote:
No worries. I am doing this in the MySQL Monitor, and I issue the command just as I typed in my first post: Code:
GRANT ALL ON * TO username IDENTIFIED BY 'my_password' WITH GRANT OPTION; Here is the PHP I use to get the results from the query on the site: php Code:
On the following line I can connect to the database if I use this, as it just uses MySQL defaults for username and password to connect to the DB. But as I said before, I feel more secure if I have specific user name and password to use when querying the DB. The Squirrel |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > Questions: users, insert, tips/advice |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|