Archive for March, 2008

Starting a web site - PHP SOLUTIONS: DYNAMIC WEB DESIGN MADE EASY 4.

Thursday, March 20th, 2008

PHP SOLUTIONS: DYNAMIC WEB DESIGN MADE EASY 4. Assuming that you have logged in successfully, as described in step 2, type the following command at the mysql> prompt: use mysql This command tells MySQL that you want to use the database called mysql, which contains all the details of authorized users and the privileges they have to work on database files. You should see the message Database changed, which means MySQL is ready for you to work on the files controlling administrative privileges. 5. Now enter the command to set a password for the root user. Substitute myPassword with the actual password you want to use. Also make sure you use quotes where indicated and finish the command with a semicolon. UPDATE user SET password = PASSWORD(’myPassword’) WHERE user = ‘root’; 6. Next, remove anonymous access to MySQL: DELETE FROM user WHERE user = ‘’; The quotes before the semicolon are two single quotes with no space in between. 7. Tell MySQL to update the privileges table: FLUSH PRIVILEGES; The sequence of commands should produce a series of results like this: 8. To exit the MySQL monitor, type exit, followed by Return. This simply ends your session with the MySQL monitor. It does not shut down the MySQL server. 9. Now try to log back in by using the same command as in step 2. MySQL won t let you in. Anonymous access and password-free access have been removed. To get in this time, you need to tell MySQL that you want to use a password: mysql -u root -p 10. When you press Return, you will be prompted for your password. Nothing will appear onscreen as you type, but as long as you enter the correct password, MySQL will let you back in. Congratulations, you now have a secure installation of MySQL.
In case you need affordable webhost to host your website, our recommendation is ecommerce web host services.

Affordable web design - SETTING UP MYSQL AND PHPMYADMIN Securing MySQL on

Wednesday, March 19th, 2008

SETTING UP MYSQL AND PHPMYADMIN Securing MySQL on Mac OS X Although you have a fully functioning installation of MySQL, by default it has no security. Even if you re the only person working on your computer, you need to set up a similar system of passwords and user accounts as on your hosting company s server. There s one important account that exists by default on all MySQL servers. It s called root, and it is the main database administrator with unlimited powers over database files. When you first install MySQL, access to the root account isn t password-protected, so you need to block this security gap. The MySQL root user, by the way, is totally unrelated to the Mac OS X root user, which is disabled by default. Enabling root for MySQL has no effect on the OS X root user. Setting the MySQL root password If you have just added MySQL to your PATH, you must close and reopen Terminal before embarking on this section. Otherwise, Terminal won t be able to find MySQL. 1. Open Terminal and type the following command: mysql -u root The command contains three elements: mysql: The name of the program -u: Tells the program that you want to log in as a specified user root: The name of the user 2. You should see a welcome message like this: 10 3. The most common problem is getting an error message like this instead: It means that mysqld, the MySQL server, is not running. Use the MySQL control panel in System Preferences to start the server. Another common problem is for Terminal to report command not found. That means you have either mistyped the command or that you haven t added the MySQL program files directory to your PATH, as described in the previous section. 275
In case you need affordable webhost to host your website, our recommendation is ecommerce web host services.

PHP SOLUTIONS: DYNAMIC WEB DESIGN MADE EASY 4. (Web hosting directory)

Wednesday, March 19th, 2008

PHP SOLUTIONS: DYNAMIC WEB DESIGN MADE EASY 4. If you have opened an existing version of .profile, add the following code on a separate line at the end. Otherwise, enter it in the blank page. export PATH=”$PATH:/usr/local/mysql/bin” 5. Select File . Save, and save the file as .profile in your own home folder. The period at the beginning of the filename should provoke the following warning: 6. Select Use . and close your text editor. Amending PATH in the bash shell in OS X 10.3 You can t edit hidden files in TextWrangler or BBEdit in OS X 10.3 (Panther), so you need to use one of Terminal s text editors. 1. Open Terminal and type the following command followed by Return: pico ~/.profile 2. If you already have a hidden file called .profile, the contents will be displayed in Terminal. Use the keyboard arrow keys to move to a new line before typing. If nothing is displayed, you can start typing straight away. Enter the following line of code: export PATH=”$PATH:/usr/local/mysql/bin” 3. Save the file by pressing Ctrl+X, and then press Y and Return. Close Terminal. Amending PATH in the tcsh shell 1. Open Terminal and enter the following command at the shell prompt: echo ’setenv PATH /usr/local/mysql/bin:$PATH’ >> ~/.tcshrc Make sure you copy everything exactly, including the quotes and spacing as shown. 2. Press Return and close Terminal. The next time you open Terminal, the MySQL program directory will have been added to your PATH.
We recommend you use shared web hosting services, because many users agree that it is cheap, reliable and customer-satisfying webhost.

Professional web hosting - SETTING UP MYSQL AND PHPMYADMIN Adding MySQL to

Tuesday, March 18th, 2008

SETTING UP MYSQL AND PHPMYADMIN Adding MySQL to your PATH You normally access MySQL through phpMyAdmin (introduced later in this chapter) or your own PHP scripts, but sometimes you need to access it directly in Terminal. To avoid having to type out the full path every time, add it to the PATH in your environmental variables. If you have a new installation of Mac OS X 10.3 or later, Terminal uses what is known as the bash shell. If you upgraded from Jaguar using Archive and Install, you will probably be using the tcsh shell. The only way to make sure is to open Terminal (in Applications . Utilities) and check the title bar. It will either say Terminal bash, as shown in the following screenshot, or Terminal tcsh. Use the appropriate set of instructions. Amending PATH in the bash shell in OS X 10.4 or later 1. Open BBEdit or TextWrangler. 2. From the File menu, choose Open Hidden and browse to your home folder. If there is a file called .profile (with a period as the first character), as shown in the screenshot, highlight it, and click Open. 3. The file exists only if you have already made changes to the way Terminal operates. If .profile doesn t exist, click Cancel, and open a blank file. 273
We recommend high quality webhost to host and run your jsp application: christian web host services.

PHP SOLUTIONS: DYNAMIC WEB DESIGN MADE EASY 2. (Web hosting uk)

Monday, March 17th, 2008

PHP SOLUTIONS: DYNAMIC WEB DESIGN MADE EASY 2. Scroll down to the Mac OS X downloads section and choose the Standard version for your processor and version of OS X there are separate packages for PowerPC, 64-bit PowerPC, and Intel Macs. The Intel Mac version is labeled x86. As you can see from the screenshot in the next step, the PKG filename includes not only the MySQL version number, but also the version of OS X and processor for which it has been compiled (osx10.4-powerpc). The size of the download file is approximately 27MB. The Mac files are listed close to the bottom of the downloads page. Make sure you don t scroll too far down. There is a separate section at the bottom for TAR files, which require manual installation. When the download starts, check that the file has a .dmg filename extension. If the file has a .tar.gz extension, cancel the download and find the Mac section higher up the page. 3. Double-click the DMG icon to mount the disk image on your desktop. 4. Double-click the mysql-standard-x.x.x.pkg icon to start the installation process. The Mac OS X installer opens. Follow the instructions onscreen. 5. Double-click the MySQLStartupItem.pkg icon, and follow the instructions onscreen. 6. Open a Finder window and drag the MySQL.prefPane icon onto Applications . System Preferences. This installs a MySQL control panel. A dialog box asks whether you want it to be available to yourself or all users. Make your choice, and click Install. The MySQL preference pane should open. Click Start MySQL Server and enter your Mac administrator password when prompted. It may take a few seconds before the preference pane reports that the server is running, as shown here. To start or stop the MySQL server in the future, open the preference pane by clicking the MySQL icon in the Other section of System Preferences.
From our experience, we are can tell you that you can find a reliable and cheap webhost service at Java Web Hosting services.

1 on 1 web hosting - SETTING UP MYSQL AND PHPMYADMIN Assuming everything went

Monday, March 17th, 2008

SETTING UP MYSQL AND PHPMYADMIN Assuming everything went well, skip ahead to the section Using MySQL with a graphical interface. If you cannot find mysql and mysqli in the PHP configuration, read on. Troubleshooting You must be able to see the mysql and mysqli entries in the PHP configuration page before attempting to go any further. Without them, you can t connect to MySQL. The most com mon cause for them failing to appear lies in Windows not reading the correct version of php.ini, or not being able to find php.ini at all. This usually happens if you had a previ ous installation of PHP and didn t remove it from the Windows system folders. After run ning phpinfo(), check the value for Configuration File (php.ini) Path (it s the sixth item from the top). If it s pointing to C:WINDOWSphp.ini or C:WINNTphp.ini, you should return to Chapter 2 and follow the advice on removing an old version of PHP. Unfortunately, this doesn t always work, as there may be other programs preventing Windows from reading the correct version of php.ini. If this happens to you, the most practical solu tion is to copy php.ini to C:WINDOWS or C:WINNT (depending on your system). You will probably also need to copy libmysql.dll to C:WINDOWSsystem32 or C:WINNTsystem32. Setting up MySQL on Mac OS X MySQL is available as a Mac PKG file, so everything is taken care of for you, apart from some minor configuration. Downloading and installing MySQL When upgrading an existing installation of MySQL, the Mac installer will not move your data files. You must first create a backup, as described at the end of this chapter, and reload them after upgrading. You must also shut down the MySQL server. If you have never installed MySQL before, you don t need any special preparations; just follow these instructions. 1. Go to www.mysql.com/downloads, and select the link for the Current Release (Recommended) of MySQL Community Edition Database Server and Client. MySQL 5 is not supported on Jaguar (OS X 10.2). Download the most recent ver- sion of MySQL 4.1 instead. It should be listed among Older Releases or Archives. 271
If you are looking for affordable and reliable webhost to host and run your business application visit our ftp web hosting services.

PHP SOLUTIONS: DYNAMIC WEB (Graphic web design) DESIGN MADE EASY Updating

Sunday, March 16th, 2008

PHP SOLUTIONS: DYNAMIC WEB DESIGN MADE EASY Updating the PHP connector files Since the release of PHP 5.0.0, the code libraries that control connection between PHP and MySQL are no longer integrated into the PHP core. MySQL recommends that you replace the following three files with versions created by MySQL: php_mysql.dll php_mysqli.dll libmysql.dll The versions created by MySQL are compiled against the most recent MySQL Client libraries, so they contain fixes for bugs that may not have filtered through to the PHP versions. It takes about a week after the release of a new version of either MySQL or PHP for the updated connector files to become available. Using the previous version of connector files should not make any difference. 1. Go to http://dev.mysql.com/downloads/connector/php. 2. Download the ZIP files for both the mysqli extension and mysql extension for the latest version of MySQL. 3. Unzip both files to a temporary folder. When you unzip the second one, you will be warned that libmysql.dll already exists. Accept the option to overwrite it. You should now have the three files as shown here in your temporary folder (the version numbers may, of course, be different). 4. Stop Apache or IIS (refer back to Chapter 2, if necessary). 5. Cut libmysql.dll to your clipboard and paste it in the main PHP folder (C:php, if you followed the recommended setup in Chapter 2). When prompted, confirm that you want to overwrite the existing file. 6. Cut php_mysql.dll and php_mysqli.dll to your clipboard and paste them in the PHP extension folder (C:phpext). Confirm that you want to overwrite the existing files. 7. Restart Apache or IIS. 8. Load a page containing the script into a browser, and check that you have entries for mysql and mysqli as shown in the following screenshots. The Client API version should be the same as the number indicated on the MySQL download site in step 2.
If you are searching for cheap webhost for your web application, please visit MySQL5 Web Hosting services.

Affordable web design - SETTING UP MYSQL AND PHPMYADMIN 3. To change

Saturday, March 15th, 2008

SETTING UP MYSQL AND PHPMYADMIN 3. To change the automatic startup option, highlight MySQL in the Services panel, right-click to reveal a context menu, and choose Properties. 4. In the dialog box that opens, activate the Startup type drop-down menu and choose Automatic, Manual, or Disabled. Click OK. That s all there is to it. Using the MySQL monitor on Windows Although most of your interaction with MySQL will be through phpMyAdmin or your own PHP scripts, it s useful to know how to access MySQL through the MySQL monitor (or the Command Line Client, as it s called in Windows Essentials). It s also a good way to test that your installation went without problems. To start a session From the Windows Start menu, select Programs . MySQL . MySQL Server 5.0 . MySQL Command Line Client. This will open the Command Line Client, which will ask you for your password. Type in the root password that you chose in step 10 of the section Configuring MySQL Windows Essentials and press Enter. As long as the server is running and you typed your password correctly you will see a welcome message similar to the one shown here. If you get your password wrong, your computer will beep and close the window. If you find this happening repeatedly, even though you re sure you typed in your password correctly, there are two likely explanations. The first is that your Caps Lock key is on MySQL passwords are case-sensitive. The other is that the MySQL server isn t running. Refer to the previous section on how to control MySQL manually before doing too much damage by banging your forehead on the keyboard. Being unable to connect to MySQL because the server isn t running is probably the most common beginner s mistake. The MySQL server runs in the background, waiting for requests. Opening the Command Line Client does not start MySQL; it opens the MySQL monitor, which is a channel for you to send instructions to the server. Equally, closing the Command Line Client does not stop MySQL. The server continues running in the background until the computer is closed down or until you stop it manually. Ending your session After you finish working with the MySQL monitor, type exit or quit at the mysql> prompt, followed by Enter. The MySQL Command Line Client window closes automatically. 269
In case you need quality webspace to host and run your web applications, try our personal web hosting services.

Ipower web hosting - PHP SOLUTIONS: DYNAMIC WEB DESIGN MADE EASY 13.

Saturday, March 15th, 2008

PHP SOLUTIONS: DYNAMIC WEB DESIGN MADE EASY 13. If you want to change the configuration at a later date, launch the Configuration Wizard from the Windows Start menu by choosing Programs . MySQL . MySQL Server 5.0 . MySQL Server Instance Config Wizard. The dialog box that opens offers the following two options: Reconfigure Instance: This takes you through all the dialog boxes again. Remove Instance: This does not remove MySQL from your system, but removes the Windows service that automatically starts MySQL when you boot your computer. Unfortunately, it also removes the MySQL configuration file. See Starting and stopping MySQL manually on Windows for a less radical solution. Changing the default table type on Windows Essentials The instructions in this section are required only if you selected Multifunctional Database in step 4 of Configuring MySQL Windows Essentials. The Windows Configuration Wizard sets InnoDB as the default table storage engine for a multifunctional database. Since most hosting companies don t support InnoDB, you should reset the default to MyISAM. All it requires is a simple change to the MySQL configuration file: my.ini. 1. Use Windows Explorer to navigate to the folder in which MySQL was installed. The default is C:Program FilesMySQLMySQL Server 5.0. 2. Locate the file called my.ini, and double-click it. The file will open in Notepad. 3. Approximately 80 lines from the top you should find a line that reads as follows: default-storage-engine=INNODB Change it to the following: default-storage-engine=MyISAM 4. Save the file and close it. To make the change effective, restart MySQL. MySQL will now create all new tables in the default MyISAM format. To use the InnoDB format for a database, you can change the table type in phpMyAdmin, the graphical interface for MySQL that you will install later in the chapter. Starting and stopping MySQL manually on Windows Most of the time, MySQL will be configured to start up automatically, and you can forget about it entirely. There are times, however, when you need to know how to start or stop MySQL manually whether for maintenance, to conserve resources, or because you re paranoid about security (a physical firewall is probably a much better solution). 1. Select Control Panel from the Windows Start menu. Double-click the Administrative Tools icon and then double-click the Services icon in the window that opens. 2. In the Services panel, scroll down to find MySQL and highlight it by clicking once. You can now use the video recorder type icons at the top of the panel to stop or start the server. The text links on the left of the panel do the same.
In case you need affordable webhost to host your website, our recommendation is ecommerce web host services.

SETTING UP (Web hosting account) MYSQL AND PHPMYADMIN The lower half

Friday, March 14th, 2008

SETTING UP MYSQL AND PHPMYADMIN The lower half of the dialog box gives you the option to include the bin directory in your Windows PATH. This option enables you to interact directly with MySQL and its related utilities at the command line with out the need to change directory every time. You won t need to do this very often if at all but selecting this option makes life a little more convenient if the occasion ever arises. Click Next. If you get a warning message that a Windows service with the name MySQL already exists, you will be asked if you want to use this name. You must click No and choose a different name from the drop- down menu in the Service Name field. 10. A fresh installation of MySQL has no security settings, so anyone can tamper with your data. MySQL uses the name root to signify the main database administrator with unrestricted control over all aspects of the database. Choose a password that you can remember, and enter it in both boxes. Unless you access your development server from a different computer over a network, leave the Enable root access from remote machines check box unchecked. Do not check Create An Anonymous Account. It will make your database insecure. If you are upgrading an existing version of Windows Essentials and want to keep your current root password, deselect the Modify Security Settings check box. If this is a first- time installation, you probably won t have this check box. Click Next when you have finished. 10 11. At long last, everything is ready. Click Execute. If you have installed a software fire- wall, it will probably warn you that MySQL is trying to connect to a DNS server. You must allow the connection; otherwise, MySQL will never work. 12. Assuming that all was okay, you should see a screen confirming that the configuration process is complete. MySQL should now be running even if you selected the option not to start automatically (the option applies only to automatic start on bootup). 267
Note: If you are looking for cheap and reliable webhost to host and run your mysql application check mysql web server services.