Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 100503 Details for
Bug 152832
Can't connect to local MySQL server through socket ''/var/run/mysqld/mysqld.sock'' (2)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Example C program which exposes bug, for me
mysqlplay.c (text/plain), 1.21 KB, created by
Greg McIntyre
on 2006-10-25 20:06:47 UTC
(
hide
)
Description:
Example C program which exposes bug, for me
Filename:
MIME Type:
Creator:
Greg McIntyre
Created:
2006-10-25 20:06:47 UTC
Size:
1.21 KB
patch
obsolete
>#include <stdio.h> >#include "mysql.h" > >int main(void) { > MYSQL conn; > const char *host = NULL; > const char *passwd = NULL; > const char *db = "mysql"; > const char *user = "root"; > const char *unix_socket = NULL; //"/var/run/mysqld/mysqld.sock"; > uint port = MYSQL_PORT; > uint client_flag = 0; > const char *query = "SELECT User FROM user;"; > int err; > MYSQL_ROW row; > MYSQL_RES *result; > > mysql_init(&conn); > printf("%s\n", mysql_error(&conn)); > mysql_real_connect(&conn, host, user, passwd, db, port, unix_socket, > client_flag); > printf("%s\n", mysql_error(&conn)); > > err = mysql_query(&conn, query); > if (err) { > printf("%s\n", mysql_error(&conn)); > } > result = mysql_store_result(&conn); > if (result) { > while (row = mysql_fetch_row(result)) { > unsigned long *lengths = mysql_fetch_lengths(result); > unsigned int num_fields = mysql_num_fields(result); > int i; > for (i = 0; i < num_fields; i++) { > printf("[%.*s] ", lengths[i], row[i] ? row[i] : "NULL"); > } > printf("\n"); > } > mysql_free_result(result); > } > mysql_close(&conn); > return 0; >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 152832
: 100503 |
100504