歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux基礎 >> Linux技術

LAMP平台

LAMP平台
mysql> use mysql;
mysql> select User,Host,Password from user;
+----------+-----------------------+-------------------------------------------+
| User | Host | Password |
+----------+-----------------------+-------------------------------------------+
| root | localhost | |
| root | localhost.localdomain | |
| root | 127.0.0.1 | |
| | localhost | |
| | localhost.localdomain | |
| admin | % | *4ACFE3202A5FF5CF467898FC58AAB1D615029441 |
| admin1 | % | *6D45FD76D5E9C6A404E39C25106A7F032659ACB8 |
| chen | % | *A174C9E936AC7A4D7B5879283828BC1949D9E699 |
| wang | % | *4DB9D7B9A1EE2F9646C3A6A1CC9A37942588BFBF |
| testuser | % | *3A2EB9C80F7239A4DE3933AE266DB76A7846BCB8 |
+----------+-----------------------+-------------------------------------------+
10 rows in set (0.00 sec)
數據庫中的所有用戶都只能本地登錄,
為用戶設定密碼的方式:
1.set password for 'USERNAME'@'HOST'=PASSWORD ('password');
mysql> set password for 'root'@'localhost'=password ( 'root' );
mysql> flush privileges; 讓系統重讀授權表
2.#mysqladmin -uroot -proot -hHOST password 'password'
3.mysql> update user set Password=password('root') where User='root' and Host='127.0.0.1'; 直接丟該表裡的數據
and
or
not
建立一個遠程連接並且具有所有權限;
mysql> grant all privileges on *.* to 'root'@'%'; identified by 'root';
圖形客戶端工具:
phpmyadmin
workbench
mysql front
navicat for mysql
toad
###########
解決navicat for mysql 報錯的問題:Lost connection to MySQL server at ‘reading initial communication packet', system error: 0
首先用vim打開my.cnf:
復制代碼 代碼如下:
vim /etc/mysql/my.cnf
看看是否有綁定本地回環地址的配置,如果有,注釋掉下面這段文字:(在文字之前加上#號即可)
復制代碼 代碼如下:
bind-address = 127.0.0.1
然後找到[mysqld]部分的參數,在配置後面建立一個新行,添加下面這個參數:
skip-name-resolve
保存文件並重啟MySQL:
復制代碼 代碼如下:/etc/init.d/mysql restart
[root@localhost ~]# yum install -y php-mysql 安裝驅動
cd /www/a.com
vi index.php
此字段將mysql和php連接到一起
<title>A</title>
<h1>a.com</h1>
<?php
$conn=mysql_connect('localhost','root','root');
if (!$conn)
echo "Success...";
else
echo "Failur...";
?>
修改配置文件後 都需要重啟服務才能生效
------------------------------------------------
<?php-mysql
$conn=mysql_connect('localhost','root1','root1');
if (!$conn)
{
die('Could not connect:' . mysql_error());
}
mysql_select_db("mydb",$conn);
$result = mysql_query("select * from tb1");
while($row = mysql_fetch_array($result))
{
echo $row['Name'] . " " . $row['Age'];
echo "<br />";
}
mysql_close();
?>
-----------------------------------------------
LAMP:
phpMyAdmin 通過php頁面管理數據庫的https://www.phpmyadmin.net/downloads/ 下載地址
只需要放到/www/a.com解壓即可通過浏覽器訪問
論壇程序:
discuz www.discuz.net
phpwind
phpbb
下載程序以後依附LAMP平台進行部署即可,下載GBK。 #Discuz_X3.2_SC_GBK
[root@localhost a.com]# mv ../upload/* ./
把upload裡的數據放到a.com裡
#AddDefaultCharset UTF-8 注釋掉UTF-8
[root@localhost a.com]# service httpd restart
CMS:
drupal
joomla
LAMP
wordpress 個人博客系統
本文出自 “運維成長路” 博客,轉載請與作者聯系!
Copyright © Linux教程網 All Rights Reserved