MySQL root password and other configuration issues |
MySQL root password and other configuration issues |
Christian J |
Jun 16 2010, 05:28 PM
Post
#1
|
. Group: WDG Moderators Posts: 9,686 Joined: 10-August 06 Member No.: 7 |
I'm finally going to try learning MySQL, and have installed a MySQL server on my computer (Windows with Apache and PHP). After some confusion I found that in order to succeed with PHP mysql_connect() I needed the username "root" and the MySQL root password created during the installation. Related questions:
- Is a root password necessary or useful on an offline testing server? Is it practical to make a new user account (with passwords?) in addition to root for each site I'm testing offline? - Any other security precautions? For example there's a "skip-networking" directive, which stops MySQL from listening on a TCP/IP port. - In phpinfo.php the "mysql.default_user" and "mysql.default_password" directives are listed. What are they used for? Apparently they're not the same as the MySQL root and password. - What is http://www.php.net/manual/en/ini.core.php#ini.sql.safe-mode used for? When enabled mysql_connect() fails, apparently because it makes PHP ignore my root password. So when do you use safe mode --when passwords are not used (sounds contradictory)? - Anything else to think of, so that my offline configurations won't differ too much from what online webhosts look like? I don't have any web host offering MySQL, so I can't check. |
geoffmerritt |
Jun 20 2010, 02:59 AM
Post
#2
|
Member Group: Members Posts: 66 Joined: 23-December 08 From: Adelaide Member No.: 7,394 |
I have Xampp for windows running on my laptop, which comes with php, apache, mysql, it is easy to setup and update.
localhost is the root of the server, setup of database can be done in phpmyadmin. I like the fact I can create a complete working site on my pc and then export the *.sql file and then import the file to the web hosting service via phpmyadmin. Using root in mysql as a user name should be avoided. It has been suggested to me that I should set up several users with different privileges and use the relevant user for the job. eg SELECT, the user should have read only privileges, etc. Maybe on my current project I will do this. |
Christian J |
Jun 20 2010, 07:40 AM
Post
#3
|
. Group: WDG Moderators Posts: 9,686 Joined: 10-August 06 Member No.: 7 |
|
pandy |
Jun 20 2010, 07:59 AM
Post
#4
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,737 Joined: 9-August 06 Member No.: 6 |
You usually don't have root anything on a shared server.
|
Lo-Fi Version | Time is now: 17th June 2024 - 07:47 AM |