Penrose连接Mysql解决方案
最近一直在进行Penrose连接Mysql的尝试,可总是提示无法连接到Mysql,无论是检查端口是否开启,设置Mysql远程访问权限等都不管用,后来在Penrose的官网找到一个建立样例数据库及设置远程连接的文档,没想到一举成功,痛快啊!
下面就把文档和大家共享一下!(是英文,大家就凑合着看下吧!因为最近搞Penrose太累了,懒的再去翻译了!)
我安装的Penrose版本是2.0的,Mysql是5.0
The following are the instructions to setup the sample database. The instructions were written for MySQL 4.x, but you can use other database systems.
Create Database
Make sure you have a MySQL server running on your local machine. Create a MySQL database called "penrose_demo". Exececute the following commands inside a MySQL client:
create database penrose_demo;
Create Database User
Create a MySQL user called "penrose" with password "penrose". Exececute the following commands inside a MySQL client:
grant all privileges on *.* to 'penrose'@'<hostname>' identified by 'penrose' with grant option;
grant all privileges on *.* to 'penrose'@'localhost' identified by 'penrose' with grant option;
grant all privileges on *.* to 'penrose'@'%' identified by 'penrose' with grant option;
注:主要是这边关于权限的设置导致我总是连接不成功!有高手能详细解释下不?
Change the <hostname> with your machine name.
Create Database Tables
Populate the database with the SQL script provided in PENROSE_HOME/samples/sql. Exececute the following commands inside a MySQL client:
use penrose_demo;
source PENROSE_HOME/samples/sql/example.sql;
注:此脚本在相应目录中没有,需自己准备sql脚本!可在mysql官网上下载到!
The script was written for MySQL 4.x. If you are using a different database system, you might need to modify the script.
相关文档:
忘记MySQL ROOT密码是在MySQL使用中很常见的问题。没想到今天就碰到这样一个问题:内部的mysql的root密码被修改了。查阅资料,有如下方法: Unix&Linux:
1.用root或者运行mysqld的用户登录系统;
2.利用kill命令结束掉mysqld的进程;
3.使用--skip-grant-tables参数启动MySQL Server
shell& ......
1、PHP发送中文、Ajax接收
只需在php顶部加入一句:
header('Content-type: text/html;charset=GB2312');
xmlHttp会正确解析其中的中文。
2、Ajax发送中文、PHP接收
这个比较复杂:
Ajax中先用encodeURIComponent对要提交的中文进行编码
PHP中:
$GB2312string=iconv( ‘UTF-8′, ‘gb2312//I ......
http://linux.chinaitlab.com/MYSQL/524755_2.html
http://bbs.chinaunix.net/archiver/?tid-809159.html
在Apache, PHP,
MySQL的体系架构中,MySQL对于性能的影响最大,也是关键的核心部分。对于Discuz!论坛程序也是如此,MySQL的设置是否合理优化,直接
影响到论坛的速度和承载量!同时,MySQL也是优化难度最大 ......
有时候nginx,apache,mysql,php编译完了想看看编译参数可以用以下方法
nginx编译参数:
#/usr/local/nginx/sbin/nginx -V
CODE:
nginx version: nginx/0.6.32
built by gcc 4.1.2 20071124 (Red Hat 4.1.2-42)
configure arguments: --user=www --group=www --prefix=/usr/local/nginx/ --with-http_stub_status_mo ......