I'm tryng to write a simple program c++ to connect to Mysql database based in my 127.0.0.1 server:
int main (void) {
cout << "\033[2J" << "\033[0;0f";
MYSQL mysql;
MYSQL *conn;
conn = mysql_init(&mysql);
cout << "conn = " << conn << "\n";
// cout << "mysql = " <
code:
#include <mysql/mysql.h>
#include <my_global.h>
int main(int argc, char **argv)
{
MYSQL *conn;
conn = mysql_init(NULL);
mysql_real_connect(conn, "localhost", "zetcode", "passwd", "testdb", 0, NULL, 0);
mysql_query(conn, "use vobd_db");
mysql_query(conn, "select * from obd_call_status limit 10")
Quote:TrevorH wrote:I'm confused... did you mean "I can't login to mysql"? Or you can login and need to change the root pa... [by fluxburn]
The story:
A couple days ago I had created a new database and added a table to it using phpMyAdmin running on the Chrome browser. I then attempted to do something else, don't remember what, using the same software, when Chrome crashed.
I then could not get into the database using my name.
Hi all, I have a basic question on MySQL:
http://de.php.net/manual/en/ref.pdo-mysql.php
"Use --with-pdo-mysql[=DIR] to install the PDO MySQL extension, where the optional [=DIR] is the MySQL base install directory."
Which file should be used for that command?
edit: think it's mysql, but I'm getting "Access denied for user 'root'@'localhost' (using password: YES)".
Hi all
I am trying to access mysql through a c program, bt am stuck with a specific error.
A bit of information:
select current_user:
root@127.0.0.1
show grants for current_user():
'GRANT ALL PRIVILEGES ON *.* TO 'root'@'127.0.0.1' IDENTIFIED BY PASSWORD 'omited'
Service string:
"C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld-nt" --defaults-file="C:\Program Files\MySQL\MySQL Server 5.0\my.ini" MySQL
Basically, I do not see any new files.
I am creating bash script that gives me size of mysql innodb log file in MB. Currently I am getting its output in bytes.
Please check it out following script and help to get output in MB.
#! /bin/sh
a=$(mysql -uroot -proot -e "SHOW VARIABLES" | grep innodb_log_file_size | cut -f2)
b=$(echo "$a/$10240" )
echo {"Innodb_log_file_size":"'$b'"' }
You should be able to get php-mysql from the same place that you got the php 5.3.6 RPMs that you have installed now. These are not CentOS supplied so trying to install the CentOS php-mysql or php53... [by TrevorH]