After setting up the computer and installing the Web server, you’re ready to install MySQL. You need to install MySQL before installing PHP because you may need to provide the path to the MySQL software when you install PHP.
But before installing MySQL, be sure that you actually need to install it. It might already be running on your computer, or it might be installed but not running. For instance, many Linux distributions automatically install MySQL.
Here’s how to check whether MySQL is currently running:
Here’s how to check to see whether MySQL is installed on your computer:
If MySQL isn’t installed on your computer, you need to download it and install it from www.mysql.com. The Web site provides all the information and software that you need.
But before installing MySQL, be sure that you actually need to install it. It might already be running on your computer, or it might be installed but not running. For instance, many Linux distributions automatically install MySQL.
Here’s how to check whether MySQL is currently running:
- Linux/Unix/Mac: At the command line, type the following: ps –ax ,The output should be a list of programs. Some operating systems (usually flavors of Unix) have different options for the ps command. If the preceding does not produce a list of programs that are running, type man ps to see which options you need to use. In the list of programs that appears, look for one called mysqld.
- Windows: If MySQL is running, it will be running as a service. To check this, choose StartControl PanelAdministrative ToolsServices and scroll down the alphabetical list of services. If MySQL is installed as a service, it will appear in the list. If it’s currently running, its status displays Started.
Here’s how to check to see whether MySQL is installed on your computer:
- Linux/Unix/Mac: Type the following: find / -name “mysql*” If a directory named mysql is found, MySQL has been installed.
- Windows: If you did not find MySQL in the list of current services, look for a MySQL directory or files. You can search at StartSearch. The default installation directory is C:\Program Files\MySQL\MySQL Server version number for recent versions or C:\mysql for older versions. If you found MySQL in the service list, as described, but it is not started, you can start it by highlighting MySQL in the service list and clicking Start the Service in the left panel.
- Linux/Unix/Mac:
- Change to the directory mysql/bin. This is the directory that you should have found when you were checking whether MySQL was installed.
- Type safe_mysqld & When this command finishes, the prompt is displayed.
- Check that the MySQL server started by typing ps -ax. In the list of programs that appears, look for one called mysqld.
- Windows:
- Open a Command Prompt window. In Windows XP, choose Start>All ProgramsAccessories Command Prompt.
- Change to the folder where MySQL is installed. For example, type cd C:\Program Files\MySQL\MySQL Server 5.0. Your cursor is now located in the MySQL folder.
- Change to the bin subfolder by typing cd bin. Your cursor is now located in the bin subfolder.
- Start the MySQL Server by typing mysqld—install.
If MySQL isn’t installed on your computer, you need to download it and install it from www.mysql.com. The Web site provides all the information and software that you need.
No comments:
Post a Comment