lamp notebook

文章浏览→编程相关Mysql→lamp notebook

lamp notebook
lamp notebook


MySql: the status of mysql:

/etc/init.d/mysqld status mysql:

service mysqld start

service mysqld stop

3.install mysql:

only to do is tar the file and then move the file to/usr/local/mysql attention to one mistake which is easy to make:

don't forget ";" at the end of every mysql command(except somecommand such as 'use database')



protect it and set a password:

Now, knowing what this cool program is capable of, its probablynot something you want just anyone to be able to access, luckily wecan take care of that very easily using Apache 's authenticationprocess, so lets do it !

Still as root make a directory to store the password file we willbe creating;

mkdir /usr/local/apache/passwd <enter>

Now, lets create the file and add an allowed user;

/usr/local/apache/bin/htpasswd -c /usr/local/apache/passwd/authpass myphp <enter>

htpasswd will prompt you for the password you would like to assignto this user, once entered, it will create the file authpass andpopulate it with the information for the user called myphp. You canuse whatever names you like, this is only an example.

Now the final step, change to your Apache configurationdirectory;

cd /usr/local/apache/conf <enter>

And again using your favorite editor, open the file namedhttpd.conf and find the following section;

<Directory />     Options FollowSymLinks     AllowOverride None  </Directory>

Directly under this section add the following (assuming you usedthe names from the example above);

<Directory "/usr/local/apache/htdocs/phpmyadmin">     AuthType Basic     AuthName "myphp"     AuthUserFile /usr/local/apache/passwd/authpass     Require user myphp  </Directory>

Thats it, save the file and close it, then restart Apache byissuing the following command;

/usr/local/apache/bin/apachectl restart <enter>


所属分类:编程相关Mysql    作者:新浪博客    时间:2010-11-20 0:00:00