码迷,mamicode.com
首页 > 数据库 > 详细

使用codeblocks调试mysql

时间:2015-04-24 16:20:26      阅读:276      评论:0      收藏:0      [点我收藏+]

标签:mysql   codeblocks   调试   

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调试mysql

标签:mysql   codeblocks   调试   

原文地址:http://blog.csdn.net/zjufirefly/article/details/45247635

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!