How to install MySQL 5.5 using a source from a non-root user?

I need a general way to install MySQL 5.5 on virtually any Linux OS from a non-root user. So I decided to install MySQL from my source and install it where I need it.

Is it possible to install MySQL as a home user without root authority? Does anyone have an idea? Please share your knowledge for the same.

The main limitation here is that I need to install MySQL 5.5 from any non-root user in a general way and possibly for almost any Linux OS.

Any suggestion would be appreciated.

Thank.

Conclusion I tried with Ubuntu-11.10, finally, I was able to install MySQL-5.5 for non-root users with the limitation that MySQL is not accessible from the command line / command line. Because mysqld works and works fine, MySQL is easily accessible through any GUI tool that connects to MySQL through JDBC connectors. If you try to access mysql from the command line using

mysql -u root -p

Team

gave out a segmentation error. Another thing I tried for Fedora Linux also with a Non-Root user is that mysqld fails and cannot access mysql anyway :(.

+5
source share
2 answers

You must configure these three variables:

MYSQL_DATADIR
SYSCONFDIR
CMAKE_INSTALL_PREFIX

Example:

$ cd <mysql_src_dir>
$ cmake -i .
    Would you like to see advanced options? [No]:Yes
    Please wait while cmake processes CMakeLists.txt files....
    ...
    Variable Name: CMAKE_INSTALL_PREFIX
    Description: install prefix
    Current Value: /usr/local/mysql
    New Value (Enter to keep current value): /home/user/mysql
    ...
    Variable Name: MYSQL_DATADIR
    Description: default MySQL data directory
    Current Value: /usr/local/mysql/data
    New Value (Enter to keep current value): /home/user/mysql/data
    ...
    Variable Name: SYSCONFDIR
    Description: config directory (for my.cnf)
    Current Value: /usr/local/mysql/etc
    New Value (Enter to keep current value): /home/user/mysql/etc
$ make
$ make install

Instead cmake -i .you can usecmake -D MYSQL_DATADIR=/home/user/mysql/data -D SYSCONFDIR=/home/user/mysql/etc -D CMAKE_INSTALL_PREFIX=/home/user/mysql .

+5

, , . Makefile, ; , , MySQL, . , mysqld, 1000 ( , MySQL 3306).

+1

All Articles