随笔分类 -  Z技术(DB/Mysql)

摘要:1.安装 Mysql Server# yum install mysql mysql-server 可以到mysql官网去下载,我下载的是通用版本。你需要下载下面四个文件就可以了。 mysql-client --------客户端包 mysql-server --------主服务器包 mysql-devel ---------开发包,作为开发者,这个是必须的,其提供开发用的头文件和库文件 mysql-shared ----共享组建包-----外部客户端使用的共享库 然后安装就可以了2.开启 MySQL server 及开机启动 MySQL# systemctl start mys... 阅读全文
posted @ 2013-06-27 17:34 Leo.cheng 阅读(2112) 评论(0) 推荐(0) 编辑
摘要:1.源码//connect-mysql.c#include #include "/usr/include/mysql/mysql.h"int main(){ MYSQL mysql;//need a instance to init int t,r;//connect the database mysql_init(&mysql); if(!mysql_real_connect(&mysql,"localhost","root","yourpassword","mysql",0, 阅读全文
posted @ 2013-06-27 17:34 Leo.cheng 阅读(895) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示