首页 电脑 电脑学堂 查看内容

如何升级mysql和php

2004-10-25 02:37 671 0

摘要: 作者xiefei  http://powers.com.cn/ 本人文字水平比较差....写的不好还请见谅.. 今天闲着无聊.就升级了一下php和mysql数据库..因为我的apache...
关键词: mysql directory data 目录 apache 一下 you 服务器 文件 location

作者xiefei  http://powers.com.cn/ 本人文字水平比较差....写的不好还请见谅.. 今天闲着无聊.就升级了一下php和mysql数据库..因为我的apache服务器安装在win系统下..php又出新的上传 文件漏洞..所以抓紧时间升级一下php..进入http://bugs.php.net/网站..找到自已安装的版本号..然后对准时间升级..Win32 PackageStable (5.0.x-dev)Download (7.4M)Built On: Sep 23, 2004 00:30 GMT看到了吧..时间是9月23号的凌晨的更新包..好的.马上下载..下载后传到服务器上..解压..覆盖..靠..不行.. 原来是apache服务器在用呢..马上进入apache目录c:/apache> apache -k stop停下apache服务器..然后覆盖..一切正常..别急..不要测试..先进入windows/system32目录下.把p hp5ts.dll干 掉..回到php目录..把新的php5ts.dll copy到system32目录..然后.重启..apache服务器c:/apache> apache -k start建一个php文件..测试一下版本..很简单..<?phpphpinfo()?>看到了吧..更新到最新版的5.0.2版了..接下来更新mysql数据库..进入http://dev.mysql.com/downloads/又有新版本出来了..原来是 MySQL 5.0.1 点击进入..下载.上传到服务器..先把服务器上的mysql干掉..不要急..先把mysql目录下的data目录备分一下copy到其他盘的目录下..现在干掉 原来的mysql..怎么干掉..不用我讲吧.很简单..进入 win的添加删除软件..把mysql干掉..呵呵..重启一下服务 器..重启好了..就安装..呵呵..不知道你们安装在哪个盘的..我们就选择安装在e盘吧..一切正常..选择运行-cmd进入e盘的mysql的bin目录>mysql -h127.0.0.1 -uroot -p>Enter password:你的密码..靠..不行..检查一下.不行啊..进入mysql目录.把data这个目录干掉...狠心一点..不要管哪么多..把原来co py 的一分data copy到这个目录下..然后再进行..靠..还是不行..别急..进入服务..看一下mysql服务..妈的..原 来没有启动..启动..不行..怎么会事..一看.原来是c盘的.my.cnf文件更名了..变成my.cnf.bak了..重 新改回成 my.cnf文件..启动..成功了.. D:\mysql\bin>mysql.exe -h127.0.0.1 -uroot -pEnter password: **********Welcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 606 to server version: 5.0.1-alpha-nt Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql>看到版本了吧..呵呵是.version: 5.0.1-alpha-nt..也可以这样看. mysql> select version();+----------------+| version()      |+----------------+| 5.0.1-alpha-nt |+----------------+1 row in set (0.00 sec)更新过来了.呵呵..如果不放心..进入user目录查看一下用户.呵呵..差点忘了..my.cnf文件的用处..呵呵.因为..mysql安装在其他盘..要建一个my.cnf文件..用来启动安装在 其他 盘的mysql服务..具体情况.去找文档..我把my.cnf文件内容给大家.. [mysqld] # set basedir to your installation path, for example, C:/mysql #basedir=the_install_path #set datadir to the location of your data directory, # for example, C:/mysql/data or D:/mydata/data datadir=the_data_path 根据这个具体改....下面就是为什么要这样改的原因..本来打算升级一下apache服务器的.发现msi版的官方网 站没有提供下载..郁闷..还是等下次吧.. On Windows, the MySQL installer places the data directory directly under the directory where you install MySQL. If you would like to use a data directory in a different location, you should copy the entire contents of the `data' directory to the new location. For example, the default installation places MySQL in `C:\mysql' and the data directory in `C:\mysql\data'. If you want to use a data directory of `E:\mydata', you must copy `C:\mysql\data' there. You will also need to use a --datadir option to specify the location of the new data directory. Normally you can use the WinMySQLAdmin tool to edit the option file `my.ini'. In this case you don't have to worry about the following discussion. There are two option files with the same function: `C:\my.cnf', and the `my.ini' file in the Windows directory. (This directory typically is named something like `C:\WINDOWS' or `C:\WinNT'. You can determine its exact location from the value of the WINDIR environment variable.) MySQL looks first for the `my.ini' file, then for the `my.cnf' file. However, to avoid confusion, it's best if you use only one of these files. Both files are plain text. If your PC uses a boot loader where the C: drive isn't the boot drive, your only option is to use the `my.ini' file. Also note that if you use the WinMySQLAdmin tool, it uses only the `my.ini' file. The `\mysql\bin' directory contains a help file with instructions for using this tool. Using the notepad program, create the option file and edit the [mysqld] section to specify values for the basedir and datadir parameters: [mysqld] # set basedir to your installation path, for example, C:/mysql basedir=the_install_path # set datadir to the location of your data directory, # for example, C:/mysql/data or D:/mydata/data datadir=the_data_path Note that Windows pathnames should be specified in option files using forward slashes rather than backslashes. If you do use backslashes, you must double them. Now you are ready to test starting the server.
声明:文章版权归原作者所有 部分文章转自互联网 如有侵权请联系 [邮箱地址] 删除

路过

雷人

握手

鲜花

鸡蛋

最新评论

返回顶部