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,722 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. |
Brian Chandler |
Jun 17 2010, 09:05 AM
Post
#2
|
Jocular coder Group: Members Posts: 2,476 Joined: 31-August 06 Member No.: 43 |
The short answers is that I don't know: I use mysql on my hosting service (pair), and am saved having to administer the db server.
For each DB I create (using the pair web interface) I get new user names (actually three: full, read-write, and read-only) and passwords. I *guess* that you need the mysql _root_ password to do things like Create new database. QUOTE In phpinfo.php the "mysql.default_user" and "mysql.default_password" directives are listed. What are they used for? I guess (again) that these are defaults php will use to connect to mysql. In a low/zero security system this would mean you don't need to suppy them to the mysql_connect() function. Perhaps? At some stage I must have an offline system for testing my shop. I would be grateful to hear any feedback on how you get on. |
Christian J |
Jun 19 2010, 05:13 PM
Post
#3
|
. Group: WDG Moderators Posts: 9,722 Joined: 10-August 06 Member No.: 7 |
|
Brian Chandler |
Jun 20 2010, 12:23 AM
Post
#4
|
Jocular coder Group: Members Posts: 2,476 Joined: 31-August 06 Member No.: 43 |
I would be grateful to hear any feedback on how you get on. Forgot to mention: using PHP I could create a DB, a DB table, and then populate the latter with some entries. So far all of it feels terribly involved compared with a nice flatfile DB, though. I recommend using phpmyadmin (what a dreadful name!) for all "setup" operations. "Setup" basically means things you will only ever do once, so writing a program to do them is a bit inefficient. Are you going to have a db system you administer every day? In which case it is definitely worth writing a program to arrange the updates conveniently. It's easy to present a colour-coded view of things like status codes. And each new program (for a new db table) gets easier and easier to write, because you copy the last one and change the bits that are different. Incidentally, yes, currently I update everything directly on the server (which is not really the thing to do), except when I am really changing something, in which case I just give the file (program? web page? what should one call it?) a different name. But I think having a complete development system locally would be a better way to do it. I certainly keep copies of all files both on the server (one continent) and here (different continent), plus roughly monthy backup copies on a CD-R. Remember there is no chance of retrieving copies of programs from Google. HTH. If you give us more concrete details of what you plan to do, perhaps more suggestions... |
Lo-Fi Version | Time is now: 26th September 2024 - 03:59 AM |