Submitted by gouki on 2013, March 9, 9:18 PM
最近在试用阿里云,但是遇到了一些问题。
我在安装数据库的时候,是通过apt-get install mysql-server进行安装的,然而我安装完后,想将数据存储到额外挂载的磁盘时,却发现数据不能写入。。。
因为我老是启动失败。。所以看了下LOG,LOG是说写入目录失败。
于是请vampire帮忙看了一下,他测试了mysql_install_db,但是。。。
XML/HTML代码
- # mysql_install_db --datadir=/server/software/mysql_data
- Installing MySQL system tables...
- 130308 16:14:25 [Warning] Can't create test file /server/software/mysql_data/AY130304113437124704.lower-test
- 130308 16:14:25 [Warning] Can't create test file /server/software/mysql_data/AY130304113437124704.lower-test
- ERROR: 1005 Can't create table 'db' (errno: 13)
- 130308 16:14:25 [ERROR] Aborting
-
- 130308 16:14:25 [Note] /usr/sbin/mysqld: Shutdown complete
-
-
- Installation of system tables failed! Examine the logs in
- /server/software/mysql_data for more information.
-
- You can try to start the mysqld daemon with:
-
- shell> /usr/sbin/mysqld --skip-grant &
-
- and use the command line tool /usr/bin/mysql
- to connect to the mysql database and look at the grant tables:
-
- shell> /usr/bin/mysql -u root mysql
- mysql> show tables
-
- Try 'mysqld --help' if you have problems with paths. Using --log
- gives you a log in /server/software/mysql_data that may be helpful.
-
- Please consult the MySQL manual section
- 'Problems running mysql_install_db', and the manual section that
- describes problems on your OS. Another information source are the
- MySQL email archives available at http://lists.mysql.com/.
-
- Please check all of the above before mailing us! And remember, if
- you do mail us, you MUST use the /usr/scripts/mysqlbug script!
oh shit,还是安装不了。试了很多都没有用。最后从官方下载了5.6的包进行安装。居然就OK了。我靠,这个源是cn.ubuntu的源啊。。。苦逼了。
所幸问题解决了。
多谢vampire,同时各位朋友也注意下。如果真的不行,也可以尝试从网上直接下载源码编译,要么。就换成中科大的源,然后再upgrade。中科大的更新比较快。
但因为要修改内容和启动参数还是有点危险的。。。
Linux | 评论:0
| 阅读:13881
Submitted by gouki on 2013, February 25, 11:29 PM
ubuntu下面有一个很不错的功能,它能够使你很方便 的添加ppa的源,那就是apt-add-repository
在我之前写的一篇博客里就有介绍此功能(关于gearman的),但在debian系统上就无法适用,因为debian下没有此功能
于是找了ubuntu下的apt-add-repository的代码,cp了一份到debian下面,但不能运行。所以google了一下,发现这么一段代码就OK了:
XML/HTML代码
- #!/bin/bash
- if [ $# -eq 1 ]
- then
- ppa_name=`echo "$1" | cut -d":" -f2 -s`
- if [ -z "$ppa_name" ]
- then
- echo "PPA name not found"
- echo "Utility to add PPA repositories in your debian machine"
- echo "$0 ppa:user/ppa-name"
- else
- echo "$ppa_name"
- echo "deb http://ppa.launchpad.net/$ppa_name/ubuntu lucid main" >> /etc/apt/sources.list
- apt-get update >> /dev/null 2> /tmp/apt_add_key.txt
- key=`cat /tmp/apt_add_key.txt | cut -d":" -f6 | cut -d" " -f3`
- apt-key adv --keyserver keyserver.ubuntu.com --recv-keys $key
- rm -rf /tmp/apt_add_key.txt
- fi
- else
- echo "Utility to add PPA repositories in your debian machine"
- echo "$0 ppa:user/ppa-name"
- fi
将这段内容存成apt-add-repository,然后cp到/usr/bin目录下,并且chmod +x 这个文件,让它有可执行的权限。
再接着使用apt-add-repository 来添加源就OK了
这个自定义的版本,在添加完源后,还会将source.list进行了修改。比ubuntu还人性化。。
参考:
1.http://cptbtptp.blog.51cto.com/3228046/620036
2.http://jolin.2001.blog.163.com/blog/static/89912172011485354567/
两篇内容细看,其实就是一样的。。
Tags: debian, ubuntu, apt, ppa
Linux | 评论:3
| 阅读:31876
Submitted by gouki on 2013, January 14, 11:02 PM
发现svn的代码有更新,却忘了与上次对比。于是svn与上一版本对比的时候就出现了标题的错误:
svn: E220001: Unreadable path encountered; access denied
其实解决方法很简单,在conf/svnserve.conf中。找到anonaccess = read这一行,(默认是注释掉的)
加入一行 anonaccess = none
再试一下,就会发现正常了。
这应该算是svn的BUG了。拜托,就算你不支持anon这样的匿名用户,你好歹默认为NONE这种值你总要存在吧。不存在 就直接造成无法访问,没权限了。
Tags: svn
Linux | 评论:0
| 阅读:26356
Submitted by gouki on 2013, January 11, 6:35 PM
Ubuntu下面安装gearman以及php的gearman扩展是需要注意一下的。
不是默认的安装就直接OK
apt-get install gearman
安装完gearman后。使用pecl install gearman安装。这时候会提示你安装新版 的libgearman
如果你直接搜索apt-cache search libgearman,会发现有很多,但其实一个都不是。。不用上当了
OK,怎么办?有人也问过这个问题:http://stackoverflow.com/questions/13312207/installing-gearman-php-extension-on-debian-6
有人这么回复 :
The reason that this doesn't work is that as the error message says, the most recent version of the PHP extension requires libgearman-1.0 (which is why the directory is named 1.0). You'll need to be at least on wheezy (which is the version after debian 6 / squeeze) to get libgearman-1.0.
It might also be a solution to compile libgearman from source, and then use checkinstall
to create a debian package that you install afterwards, or use the gearman developer ppa available at https://launchpad.net/~gearman-developers/+archive/ppa
. We've built libgearman, gearmand and the PHP extension on a wide variety of distributions (including Debian, Ubuntu, RHEL4 and SL6) and used checkinstall to get a proper package available.
嗯,打开这个网址。
在最上面有提醒你怎么将PPA将入源里:
Adding this PPA to your system
You can update your system with unsupported packages from this untrusted PPA by adding ppa:gearman-developers/ppa to your system's Software Sources. (Read about installing)
OK,那我们开始吧:
apt-add-repository ppa:gearman-developers/ppa
然后,你根据你的版本,将源加到你的source.list文件里:
vim /etc/apt/source.list
加入:
deb http://ppa.launchpad.net/gearman-developers/ppa/ubuntu precise main deb-src http://ppa.launchpad.net/gearman-developers/ppa/ubuntu precise main
然后:apt-get update
apt-get upgrade
会提醒你需要升级gearman到最新版 本
这时候再:
pecl install gearman
然后就直接安装成功,会提示你怎么操作:XML/HTML代码
- Build process completed successfully
- Installing '/usr/lib/php5/20090626+lfs/gearman.so'
- install ok: channel://pecl.php.net/gearman-1.1.1
- configuration option "php_ini" is not set to php.ini location
- You should add "extension=gearman.so" to php.ini
按照提示操作完后,重启apache。
在命令行下执行:XML/HTML代码
- # php -i |grep gearman
- gearman
- gearman support => enabled
- libgearman version => 0.40
wow...安装成功。
就是这么简单
Tags: ubuntu, gearman, php扩展
Linux | 评论:0
| 阅读:18468
Submitted by gouki on 2012, November 17, 10:27 PM
这是一个小笔记。以前也记过,只是后来忘了。其实就几行代码而已:
http://jingyan.baidu.com/article/4b07be3c193d1648b380f3a9.html
- <directory xxx>
- # 设置可以访问服务器的IP
- Allow From 192.168.1.12 220.133.*.*/255.255.255.255
- Order deny,allow
- Deny from all
- </directory>
上面的URL中更加详细 我这个只是一个简单的demo而已。
Linux | 评论:0
| 阅读:13301