1.MYSQL版本
mysql-5.0.45.tar.gz2 安装步骤
$ ../configure --prefix=/home/work/local/mysql --with-charset=gb2312 --with-extra-charsets=all
$make
$make install
此时mysql就安装到电脑中了。下面开始配置mysql,让mysql真正运行起来。
3 配置mysql
$mkdir /home/work/local/mysql/etc
$cd /home/work/local/mysql
$cp /share/mysql/my-large.cnf etc/my.cnf
修改my.cnf文件中[client]
port = 8817
socket = /home/work/mysql_tmp/mysql.sock
[mysqld]
port = 8817
socket = /home/work/mysql_tmp/mysql.sock
4 初始化授权表
$ ./mysql_install_db
5 启动mysql
/home/work/local/mysql/bin/mysqld_safe &
6 连接mysql
/home/work/local/mysql/bin/mysql -uroot -P8817
7 给root用户设置密码
./bin/mysqladmin -uroot password 'work8816'
关闭mysql
./bin/mysqladmin -uroot -pwork8816 -P8816 shutdown
4.17 解决一个问题
====4.16到4.17在用php调用msyql时提示连接失败,后来在同事帮助下,发现仅仅是安装了mysql是行的 还需要将将mysql和php,apache关联起来。
因此重新安装了php
配置如下:
$./configure --prefix=/home/work/local/php --with-apxs2=/home/work/local/apache/bin/apxs --with-curl --enable-exif --enable-ftp --en
able-soap --with-iconv --with-pdo-mysql=/home/work/local/mysql --with-mysql=/home/work/local/mysql --with-mysqli=/home/work/local/my
sql/bin/mysql_config
$make
$make install
4.17 tips [1]
想将<user_edit.php> 左右两边的'<' '>'删掉,可用的方法为:
$webpage = "<user_edit.php>"
$webpage = ltrim($webpage,'<');
$webpage = rtrim($webpage,'>');
4.17 解决问题二:
Could not connect: Access denied for user 'root'@'localhost'
http://stackoverflow.com/questions/6445917/connect-failed-access-denied-for-user-rootlocalhost-using-password-yes
GRANT ALL ON *.* TO work@'%' identified by "123456";
4.17 Tips [2]
mysql的基本操作(连接,修改密码,增加用户..)
http://hi.baidu.com/cxh1984/blog/item/f1e8920aadd74b1b94ca6b1e.html
str_replace( )命令的使用
str_replace($search,$replace,$str)
匹配单引号 '\''
匹配双引号"\""
tip[3]
vi编辑
~/.vimrc
syntax on
set expandtab
set shiftwidth=4
set tabstop=4
locale
export LC_ALL=en_US.UTF-8