0

I am new to building server, I need to install MySQL server on CentOS 5.10 (64-bit). I used source code for the installation as I cannot use the root account.

I have finished cmake, make, make install process, it goes fine, but when I tried to start the server, it said "can't connect to mysql server through socket ". I guess it's because I do not have /tmp/mysql.sock and I cannot find any mysql.sock created under my basedir.

Is there any way to create the mysql.sock under a desired directory? I do not have the access right to the /tmp/ dir, please help!

EDIT

When I cmake the files, I have added options to change data dir, tmp dir, mysql.sock, hoping to create the mysql.sock and the data dir under my desired path, like user/ws1/mysql/,however it seems that doesn't work, is there any way to do so?

CLs
  • 3
  • 3
  • possible duplicate of [Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (38)](http://stackoverflow.com/questions/5376427/cant-connect-to-local-mysql-server-through-socket-var-mysql-mysql-sock-38) – Holger Just Apr 09 '15 at 14:02
  • [docs](https://dev.mysql.com/doc/refman/5.1/en/server-options.html): `mysqld --socket=/tmp/whatever.sock`. – Marc B Apr 09 '15 at 14:21
  • @HolgerJust I do not have mysql.sock generated under my path – CLs Apr 13 '15 at 05:27

2 Answers2

0

You need to start the server before you connect to it with the mysql command. To start it try running support-files/mysql.server start .

Enrico
  • 333
  • 3
  • 5
  • I have tried and it gives "The server quit without updating PID file (/FAILED/mysqlpath/data/xxx. pid )" – CLs Apr 13 '15 at 01:17
  • `mysql.server.sh: line 256: my_print_defaults: command not found mysql.server.sh: line 263: @HOSTNAME@: command not found mysql.server.sh: line 276: cd: @prefix@: No such file or directory Starting MySQLCouldn't find MySQL server (@bindir@/mysqld_s[FAILED]` I have my_print_defaults under /MySQL/bin/ – CLs Apr 14 '15 at 01:21
0

After cmake, make, make install, you need to go to /usr/local/mysql/scripts and execute mysql_install_db -u root before starting MySQL. Hope this will help ~