Compiling & Debugging MariaDB(and MySQL) in Eclipse_MySQL

php中文网
发布: 2016-06-01 13:12:31
原创
1180人浏览过

MariaDB

Introduction:

to run mariadb from eclipse we will actually create and install the tar.gz package resulting from compilation(seepart 2) in a separate directory, this will allow us to have mariadb cleanly installed on a separate location and so it will be also easily possible to run it independently from eclipse.

In these Blog posts series we assume:

<tt>yoda							as developer user/home/yoda (or ~)	 				as home directory of developer(yoda) usermariadb-10.0.11 					as sources version (and general prefix)MariaDB10-test1 					as Eclipse project name/home/yoda/playground 					as root working directory for sources, project, and installation/home/yoda/playground/mariadb-10.0.11			as sources directory/home/yoda/playground/mariadb-10.0.11-eclipse		as project/working directory/home/yoda/playground/mariadb-10.0.11-linux-x86_64	as binary deployement directory</tt>
登录后复制

Replace accordingly the strings from this example to reflect your choices.

Section 3: "Install MariaDB in Eclipse"

3.1 CREATING THE PACKAGE

We have to ways to create the .tar.gz package

* In command line
* In Eclipse

Command line:
<tt><br> $ cd ~/playground/mariadb-10.0.11-eclipse<br> $ make package<br></tt>

At the end of the execution the package will be created and it should be namedmariadb-10.0.11-linux-x86_64.tar.gz(i686 instead of x86_64 on 32 bit Linux)

Eclipse:

Right Click on the project name(MariaDB10-test1) and choose:Make Target-->Create,
in the popup windowAdda new target just inserting the name in the first field:package, click onOk.
Now Right Click again on the project name and choose:Make Target-->Build, choosepackagefrom the list and clickBuild.

Check on Eclipse Log Console that the package is being created.

At this point, either method chosen, you should have the packagemariadb-10.0.11-linux-x86_64.tar.gzin the project directory (mariadb-10.0.11-eclipse).

3.2 INSTALL THE PACKAGE

We need at this point to run some commands from the shell:

<tt><br> $ cd ~/playground/<br> $ mv mariadb-10.0.11-eclipse/mariadb-10.0.11-linux-x86_64.tar.gz .<br> $ tar -zxvf mariadb-10.0.11-linux-x86_64.tar.gz<br> $ cd mariadb-10.0.11-linux-x86_64<br> $ scripts/mysql_install_db --basedir=`pwd` --datadir=`pwd`/data --user=yoda<br></tt><code>

If all is good now you have a working MariaDB installation in~/playground/mariadb-10.0.11-linux-x86_64

Find JSON Path Online
Find JSON Path Online

Easily find JSON paths within JSON objects using our intuitive Json Path Finder

Find JSON Path Online 193
查看详情 Find JSON Path Online

Section 4: "Running MariaDB in Eclipse"

4.1 Create a 'Run configuration' and Run

Assuming the full path to binaries is:/home/yoda/playground/mariadb-10.0.11-linux-x86_64.

Right Click on the project (or open theRunmenu) and click onRun As-->Run configurations...,
SelectC/C++ Application, right click and chooseNew.

Compile only two parameters in the respective tabs,MainandArguments

<u>Main</u>(tab):
ClickBrowseand select/home/yoda/playground/mariadb-10.0.11-linux-x86_64/bin/mysqld

<u>Arguments</u>(tab):
<tt>--basedir=/home/yoda/playground/mariadb-10.0.11-linux-x86_64 --datadir=/home/yoda/playground/mariadb-10.0.11-linux-x86_64/data --plugin-dir=/home/eclipse/10011/lib/plugin --user=yoda --log-error=error.log --pid-file=mysql.pid --socket=10011.sock --port=10011</tt><code>

Click onApplyand then you can click onRun, as usual check the progress in the Eclipse log Console,

A<font color="red">[Warning]</font>about the user switch is totally fine, if you got only one warning about the user it means you probably managed to run succesfully MariaDB from Eclipse.

4.2 Checking if MariaDB is running

At this point we want to check if MariaDB is actually running:
<tt><br> $ cd ~/playground<br> $ cd mariadb-10.0.11-linux-x86_64<br> $ bin/mysql -uroot -h127.0.0.1 -P10011 -e"SHOW GLOBAL VARIABLES LIKE 'version'"<br></tt><code>

If you see the output:
<tt><br> +---------------+-----------------------+<br> | Variable_name | Value |<br> +---------------+-----------------------+<br> | version | 10.0.11-MariaDB-debug |<br> +---------------+-----------------------+<br> 1 row in set (0.01 sec)<br></tt><code>

Your MariaDB is happily running, Congratulations!

In the next Part 4(available soon) you will learn how to debug MariaDB under Eclipse.
You may also want to reviewPart 1andPart 2.

This is the end of Part 3.

最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
热门推荐
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号