1. mysql安装配置(点我)
2. 创建数据库和数据库用户
2.1 以root身份登陆mysql server
./bin/mysql --defaults-file=mysql.cnf -u root -p
2.2 创建数据库和用户
CREATE DATABASE orthomcl; #建数据库
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE VIEW,CREATE, INDEX, DROP on orthomcl.* TO orthomcl@localhost; #授权
set password for orthomcl@localhost = password('123456');
3. 为mysql安装perl依赖包
3.1 检查依赖包是否安装(不报错说明已经安装,反之报错)
$ perl -MDBI -e 1 (我的不报错说明已安装)
$ perl -MDBD::mysql -e 1 (报错,需要安装,见步骤3.2)
3.2 以root身份安装,没有root见3.2s
perl -MCPAN -e shell
cpan> o conf makepl_arg "mysql_config=/share/soft/mysql/bin/mysql_config"
cpan> install Data::Dumper
cpan> install DBI
cpan> force install DBD::mysql
若遇到:“ install_driver(mysql) failed: Can’t load ‘/usr/local/lib64/perl5/auto/DBD/mysql/mysql.so’ for module DBD::mysql: libmysqlclient.so.18: ” 类似的错误,把libmysqlclient.so.18所在目录的路径名加到“/etc/ld.so.conf”文件中,接着运行ldconfig即可(详情点我)
方法一:定义用户自定义的CPAN,通过CPAN安装DBI::mysql模块(orthomcl软件中mysqlInstallGuide.txt提供的安装方法)
Installing modules as a standard user
– Follow the steps below to install modules as a non-root user. We
assume /myperl in your home directory is your custom perl directory.
1. In your home directory, create the PERL and CPAN directories, and
a blank CPAN config module:
\$ mkdir myperl
\$ mkdir .cpan
\$ mkdir .cpan/CPAN
\$ echo “\$CPAN::Config = {}”> ~/.cpan/CPAN/MyConfig.pm
2. Configure your environment by adding the following to your
.bash_profile file in your home directory:
######################################
if [ -z “\$PERL5LIB” ]
then
# If PERL5LIB wasn’t previously defined, set it…
PERL5LIB=~/myperl/lib
else
# …otherwise, extend it.
PERL5LIB=$PER