linux中源码编译安装mysql常见错误

(一)
#./configure --prefix=/usr/local/mysql-5.1.54
(mysql指定路径安装报错:)

如下:
checking for termcap functions library... configure: error: No curses/termcap library found
安装:
ncurses-devel.***.rpm 包解决
#cd /media/CentOS_5.5_Final/CentOS/
#ls ncurses-devel*
找到这个包并用rpm安装。
# rpm -ivh ncurses-devel-5.5-24.20060715.i386.rpm
(或者去下载一个ncurses-5.6.tar.gz,
wget http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.6.tar.gz 解压并安装)

(二)
make时出错
../depcomp: line 571: exec: g++: not found
make[1]: *** [my_new.o] 错误 127
make[1]: Leaving directory `/usr/local/src/mysql/mysql-5.1.32/mysys`
make: *** [all-recursive] 错误 1
解决:
#yum install gcc-c++ 可解决问题。
重新指定安装路径:
#./configure --prefix=/usr/local/mysql-5.0.90
make
make install
?

(三)
初始化数据库时出错:
# scripts/mysql_install_db --user=mysql

#bin/mysql_install_db --basedir=/usr/local/mysql-5.1.54 --datadir=/usr/local/mysql-5.1.54/data --user=mysql
[Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-
external-locking' instead.
?
(解决方法:将my.cnf 中的'--skip-locking' 换成'--skip-external-locking' 就可以了。)
?
(四)修改/etc/my.cnf 的配置文件:
[client]
#password = your_password
port = 3306
socket = /tmp/mysql.sock
# Here follows entries for some specific programs
# The MySQL server
[mysqld]
port = 3306
socket = /tmp/mysql.sock
basedir=/usr/local/mysql-5.1.54
datadir=/usr/local/mysql-5.1.54/data
skip-external-locking
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

(五:提示:)
出错时,可及时查看错误日志:
vi /usr/local/mysql-5.1.54/data/localhost.localdomain.err
显示如下:
110107 22:06:31 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql-5.1.54/data
110107 22:06:31 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use
'--skip-external-locking' instead.
/usr/local/mysql-5.1.54/libexec/mysqld: Table 'mysql.plugin' doesn't exist
110107 22:06:31 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
110107 22:06:31 [ERROR] Can't start server : Bind on unix socket: No such file or directory
110107 22:06:31 [ERROR] Do you already have another mysqld server running on socket: var/lib/mysql/mysql.sock
?
110107 22:06:31 [ERROR] Aborting
?
小结1:
mysql 的启动方式:
(1)
#cd /usr/local/ mysql-5.1.54/libexec
#./mysqld --defaults-file=../my.cnf --user=mysql
(2)
#cd /usr/local/mysql-5.1.54/bin
#./mysqld_safe --defaults-file=../my.cnf --user=mysql
(3)
#mysql -S /tmp/mysql.sock
(4)
#cd /usr/local/mysql-5.1.54/share/mysql
#./mysql.server start
(可以将mysql添加的系统服务中)
#cp ./mysql.server /etc/init.d/mysql
#chkconfig --add mysql
#service mysql start

转载于:https://my.oschina.net/xxjbs001/blog/286604

### 回答1: 在 CentOS 7 源码编译安装 TiDB 步骤如下: 1. 下载 TiDB 源码: ``` $ git clone https://github.com/pingcap/tidb.git $ cd tidb ``` 2. 编译安装 TiDB: ``` $ make $ make install ``` 3. 配置并启动 TiDB: - 在 `tidb/cmd/tidb-server` 目录下创建一个 `tidb-server.toml` 配置文件,然后配置需要的参数,具体参数可以参考文档。 - 启动 TiDB 服务: ``` $ tidb-server -config=tidb-server.toml ``` 注意:在安装 TiDB 之前,你需要安装 Go 语言的开发环境。 参考文档:https://docs.pingcap.com/zh/tidb/stable/install-tidb-from-source ### 回答2: 在CentOS 7,要编译安装一个TiDB,需要执行以下步骤: 1. 首先,确保系统已经安装编译和构建所需的软件包。使用以下命令安装这些软件包: ``` sudo yum install -y git gcc make cmake autoconf automake libtool pkgconfig bison flex ``` 2. 下载TiDB的源代码。通过Git克隆TiDB代码仓库到本地文件夹: ``` git clone https://github.com/pingcap/tidb.git ``` 3. 进入TiDB源代码目录: ``` cd tidb ``` 4. 编译和构建TiDB。执行以下命令编译和构建TiDB: ``` make ``` 这个过程可能需要一些间,取决于系统配置和网络速度。 5. 安装TiDB。编译成功后,执行以下命令将TiDB安装到系统: ``` make install ``` 安装过程会将编译生成的二进制文件和依赖项复制到系统路径。 6. 配置和启动TiDB。进入TiDB源代码目录,使用以下命令进行配置和启动: ``` cd bin ./tidb-server ``` 这将启动TiDB服务器,并监听默认端口。 通过以上步骤,在CentOS 7成功编译安装了一个TiDB实例。 ### 回答3: 在CentOS 7源码编译安装TiDB,您可以按照以下步骤进行操作: 1. 安装必要的依赖:首先,确保已经安装了Git、Go和GCC等必要的软件包。您可以使用以下命令安装这些依赖: ``` sudo yum install git go gcc ``` 2. 下载源代码:使用Git命令克隆TiDB的源代码库到相应的目录。例如,您可以使用以下命令将源代码克隆到`/opt/tidb`目录: ``` git clone https://github.com/pingcap/tidb.git /opt/tidb ``` 3. 编译安装:进入源代码目录并执行以下命令来编译安装TiDB: ``` cd /opt/tidb make make deploy ``` 这些命令将在编译后生成的`bin`目录输出编译好的可执行文件,并将其安装到指定的目录。 4. 配置和启动:编辑`conf`目录下的配置文件,根据自己的需求进行相应的配置。然后,使用以下命令启动TiDB: ``` cd /opt/tidb ./bin/tidb-server -config=conf/tidb.toml ``` TiDB将在默认端口4000上启动。 以上就是在CentOS 7源码编译安装TiDB的基本步骤。请注意,在执行步骤2之前,请确保已经安装了正确版本的Git、Go和GCC等软件包。另外,如果遇到依赖问题,请根据错误提示安装相应的依赖软件包。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值