11.07.2015 Views

PHP MySQL - Stilson.net

PHP MySQL - Stilson.net

PHP MySQL - Stilson.net

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 26 • INSTALLING AND CONFIGURING MYSQLwww.it-ebooks.infotext in a wide variety of languages; or manually select the character set of yourchoosing. After you make your choice, click Next.7. Next, you’ll be prompted to determine whether <strong>MySQL</strong> should be installed as aWindows service, meaning it can be started automatically at system startup,and shut down at system shutdown or reboot. If this will be a server, or if youplan to regularly develop with the machine, consider installing it as a Windowsservice and enabling the checkbox for starting <strong>MySQL</strong> automatically.Additionally, you can add <strong>MySQL</strong>’s bin directory to the Windows path,meaning you’ll be able to access any of <strong>MySQL</strong>’s utilities from the commandline without having to be in the bin directory. These tools are discussed infurther detail in Chapter 28. Enabling both of these options is recommended.Once you’re done, click Next.8. In the final configuration window, you’ll be prompted to choose and confirm aroot password. Take care to choose a secure password, but make sure it isn’tsomething you’ll forget! You can also choose to enable root access fromremote machines, a feature that is not recommended if you don’t plan to allowremote connections to this database. You can also choose to create ananonymous account, something that isn’t recommended under anycircumstances. Click Next, and in the next window, start the configurationprocess by clicking Execute. Once the process is complete, click Finish.Assuming that you used the <strong>MySQL</strong> Configuration Wizard, the root password is already set.However, you still may want to read the next section, which describes how to change that password asnecessary.Setting the <strong>MySQL</strong> Administrator PasswordUnless you used the Windows <strong>MySQL</strong> Configuration Wizard described in the previous section, the root(administrator) account password is left blank. Although this practice seems quite questionable, it haslong been the default when installing <strong>MySQL</strong> and likely will be for some time into the future. Therefore,you must take care to add a password immediately! You can do so using the SET PASSWORD commandfrom within the <strong>MySQL</strong> client utility. To execute this command, open a command-prompt and executethe following command:%>mysql -u root mysqlOnce you’ve entered the <strong>MySQL</strong> client, execute the following command to change the root user’spassword:mysql>SET PASSWORD FOR root@localhost=PASSWORD('secret');Of course, choose a password that is a tad more complicated than secret. <strong>MySQL</strong> will let you digyour own grave in the sense that passwords such as 123, abc, and your mother’s name are all perfectlyacceptable. Consider choosing a password that is at least eight characters long and consists of acombination of numeric and alphabetical characters of varying case.Failing to heed the advice to set a password immediately means that anybody with access to theoperating system can shut down the daemon, not to mention completely destroy your database serverand its data. Although there is nothing wrong with doing a little experimentation right after the494

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!