Jump to content

Recommended Posts

Hey

 

I\'ve pretty much just started using MySQL, and having installed it for my local server (Windows 2000 with IIS) and set the password for the root user I still find I can connect to my MySQL server without giving either a username or a password. This means I can run SQL statements in my PHP pages without specifying a connection to MySQL.

 

What do I do to ensure a password is needed to connect to the MySQL server?

 

Thanks, much appreciated

 

Adam

Link to comment
https://forums.phpfreaks.com/topic/255-connecting-to-mysql/
Share on other sites

Read this:

http://robouk.mchost.com/tuts/tutorial.php...utorial=server1

 

Browse to the setup area dealing with mysql tells you how to set a password for \"root\" the default user for mysql, also you can simply \"find and delete\" my.ini on your system and then re-run mysqladmin if your user newer 3.51+ versions of mysql it should prompt u for a username and password... Then in phpmyadmin go into the mysql databse find the users table and delete all entries \"ACCEPT\" for the user/password you currently want to use so is only one valid user/pass in the database.

Link to comment
https://forums.phpfreaks.com/topic/255-connecting-to-mysql/#findComment-826
Share on other sites

Thanks a lot, that was really helpful :D

 

I have another question though about performance. I\'m using PHP and MySQL to search a catalog of around 2000 books by author, title and publisher. Firstly, is searching 3 attributes (all varchar) with this many rows going to be really slow?

 

Secondly, the way I\'ve written my script at the moment the query is run every time a new page of results is displayed, so if there are 3 pages of results the query will be run 3 times even though the result set is the same, just starting further down the rows. Is there any way to get around this, or is this generally how all multiple results pages work?

 

Thanks again

Link to comment
https://forums.phpfreaks.com/topic/255-connecting-to-mysql/#findComment-923
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.