使用codeblocks调试mysql

codeblocks调试mysql环境搭建

1.将mysql-5.6.23.zip解压到用户根目录~/

2.在用户根目录~/,新建文件夹build和mysql

3.打开codeblocks,新建空工程,工程名输入mysql,Folder to create project in:选择~/build,点击next,再点击finish

4.选择mysql工程,project->add file recursively,选择~/mysql-5.6.23目录,wildcard select中添加*.ic,*.ih,点击OK

5.~/build目录下执行如下命令
    cmake ../mysql-5.6.23 \
        -DCURSES_LIBRARY=/usr/lib/x86_64-linux-gnu/ \
        -DCURSES_INCLUDE_PATH=/usr/include/ \
        -DCMAKE_INSTALL_PREFIX=~/mysql/ \
        -DMYSQL_DATADIR=~/mysql/data \
        -DDEFAULT_CHARSET=utf8 \
        -DDEFAULT_COLLATION=utf8_general_ci \
        -DEXTRA_CHARSETS=all \
        -DENABLED_LOCAL_INFILE=1


6.project->properties->project setting中勾选This is custom Makefile,Execution directory选择~/build目录,即../../build

7.project->build options->Debug->make commands去掉$target,build project/target:的make后加-j4,点击OK

8.build->build

9.~/build目录下执行make install


10.~/mysql目录下执行scripts/mysql_install_db --user=mysql

11.project->properies->build targets,将output filename修改为../sql/mysqld,即~/build/sql/mysqld

12.设置断点,debug->start/continue

13.~/mysql/bin目录下执行./mysqladmin -u root -p password 123456,修改后密码为123456

14.~/mysql/bin目录下执行./mysql -uroot -p登录

15.执行如下命令,使可以远程连接
    use mysql;
    update user set host = '%' where user = 'root' and host = 'hp';
    flush privileges;

16.修改远程连接密码
    update user set password=password('123456') where user='root' and host = '%';
    flush privileges;

生成CodeBlocks工程
-DCURSES_LIBRARY=/usr/lib/x86_64-linux-gnu/ -DCURSES_INCLUDE_PATH=/usr/include/ -DCMAKE_INSTALL_PREFIX=~/project/cb_mysql/ -DMYSQL_DATADIR=~/project/cb_mysql/data -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DEXTRA_CHARSETS=all -DENABLED_LOCAL_INFILE=1 -G”CodeBlocks - Unix Makefiles”

windows调试

http://www.2cto.com/database/201407/316681.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值