2017-02-24 127 views
0

我試圖在沒有root權限的情況下在Redhat服務器上安裝MySQL 5.7。我下載了源代碼,並且編譯和安裝順利。但是當我運行mysqld時,它總是彈出錯誤。在沒有管理權限的情況下在Linux上安裝mysql服務器

我跟着上 http://www.martijn-onderwater.nl/2010/11/23/installing-mysql-on-linux-without-root-privileges/

指令和我創建了一個my.cnf文件

[mysqld] 
port=3306 
socket=/afs/crc.nd.edu/user/j/jlai1/MySQL/thesock 
basedir=/afs/crc.nd.edu/user/j/jlai1/MySQL 
datadir=data 
pid-file=$HOME/MySQL/mysql.pid 
user=root 

[client] 
port=3306 
socket=$MySQL_HOME/thesock 
user=root 

[mysqladmin] 
socket=$MySQL_HOME/thesock 
user=root 

當我運行./bin/mysqld --defaults文件= my.cnf中--initialize ,它工作正常。但我遇到以下問題

./bin/mysqld --defaults-file=my.cnf 
2017-02-24T16:04:40.098102Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 
2017-02-24T16:04:40.098259Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled 
2017-02-24T16:04:40.098302Z 0 [Note] ./bin/mysqld (mysqld 5.7.17) starting as process 1786 ... 
2017-02-24T16:04:40.103470Z 0 [Warning] One can only use the --user switch if running as root 

2017-02-24T16:04:40.105092Z 0 [Note] InnoDB: PUNCH HOLE support available 
2017-02-24T16:04:40.105121Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 
2017-02-24T16:04:40.105128Z 0 [Note] InnoDB: Uses event mutexes 
2017-02-24T16:04:40.105137Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier 
2017-02-24T16:04:40.105143Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3 
2017-02-24T16:04:40.105466Z 0 [Note] InnoDB: Number of pools: 1 
2017-02-24T16:04:40.105593Z 0 [Note] InnoDB: Using CPU crc32 instructions 
2017-02-24T16:04:40.106782Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M 
2017-02-24T16:04:40.115005Z 0 [Note] InnoDB: Completed initialization of buffer pool 
2017-02-24T16:04:40.117871Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority(). 
2017-02-24T16:04:40.133076Z 0 [Note] InnoDB: Highest supported file format is Barracuda. 
2017-02-24T16:04:40.150182Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables 
2017-02-24T16:04:40.150804Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ... 
2017-02-24T16:04:40.279174Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB. 
2017-02-24T16:04:40.280871Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active. 
2017-02-24T16:04:40.280904Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active. 
2017-02-24T16:04:40.281963Z 0 [Note] InnoDB: Waiting for purge to start 
2017-02-24T16:04:40.332115Z 0 [Note] InnoDB: 5.7.17 started; log sequence number 2534599 
2017-02-24T16:04:40.332297Z 0 [Note] InnoDB: Loading buffer pool(s) from /afs/crc.nd.edu/user/j/jlai1/MySQL/data/ib_buffer_pool 
2017-02-24T16:04:40.332547Z 0 [Note] Plugin 'FEDERATED' is disabled. 
2017-02-24T16:04:40.337533Z 0 [Note] InnoDB: Buffer pool(s) load completed at 170224 11:04:40 
2017-02-24T16:04:40.340352Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key 
2017-02-24T16:04:40.340424Z 0 [Note] Server hostname (bind-address): '*'; port: 3306 
2017-02-24T16:04:40.342270Z 0 [Note] IPv6 is not available. 
2017-02-24T16:04:40.342313Z 0 [Note] - '0.0.0.0' resolves to '0.0.0.0'; 
2017-02-24T16:04:40.342355Z 0 [Note] Server socket created on IP: '0.0.0.0'. 
2017-02-24T16:04:40.344528Z 0 [ERROR] Can't start server : Bind on unix socket: Operation not permitted 
2017-02-24T16:04:40.344546Z 0 [ERROR] Do you already have another mysqld server running on socket: /afs/crc.nd.edu/user/j/jlai1/MySQL/thesock ? 
2017-02-24T16:04:40.344563Z 0 [ERROR] Aborting 

2017-02-24T16:04:40.344584Z 0 [Note] Binlog end 
2017-02-24T16:04:40.344674Z 0 [Note] Shutting down plugin 'ngram' 
2017-02-24T16:04:40.344686Z 0 [Note] Shutting down plugin 'partition' 
2017-02-24T16:04:40.344692Z 0 [Note] Shutting down plugin 'BLACKHOLE' 
2017-02-24T16:04:40.344699Z 0 [Note] Shutting down plugin 'ARCHIVE' 
2017-02-24T16:04:40.344704Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA' 
2017-02-24T16:04:40.344805Z 0 [Note] Shutting down plugin 'MRG_MYISAM' 
2017-02-24T16:04:40.344813Z 0 [Note] Shutting down plugin 'MyISAM' 
2017-02-24T16:04:40.344830Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL' 
2017-02-24T16:04:40.344835Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES' 
2017-02-24T16:04:40.344840Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES' 
2017-02-24T16:04:40.344844Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS' 
2017-02-24T16:04:40.344849Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN' 
2017-02-24T16:04:40.344853Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS' 
2017-02-24T16:04:40.344858Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS' 
2017-02-24T16:04:40.344862Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES' 
2017-02-24T16:04:40.344866Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS' 
2017-02-24T16:04:40.344871Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES' 
2017-02-24T16:04:40.344875Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE' 
2017-02-24T16:04:40.344880Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE' 
2017-02-24T16:04:40.344895Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG' 
2017-02-24T16:04:40.344899Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED' 
2017-02-24T16:04:40.344904Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED' 
2017-02-24T16:04:40.344908Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD' 
2017-02-24T16:04:40.344913Z 0 [Note] Shutting down plugin 'INNODB_METRICS' 
2017-02-24T16:04:40.344917Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO' 
2017-02-24T16:04:40.344921Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS' 
2017-02-24T16:04:40.344926Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU' 
2017-02-24T16:04:40.344932Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE' 
2017-02-24T16:04:40.344936Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET' 
2017-02-24T16:04:40.344941Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX' 
2017-02-24T16:04:40.344946Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET' 
2017-02-24T16:04:40.344951Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM' 
2017-02-24T16:04:40.344955Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET' 
2017-02-24T16:04:40.344960Z 0 [Note] Shutting down plugin 'INNODB_CMP' 
2017-02-24T16:04:40.344964Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS' 
2017-02-24T16:04:40.344969Z 0 [Note] Shutting down plugin 'INNODB_LOCKS' 
2017-02-24T16:04:40.344973Z 0 [Note] Shutting down plugin 'INNODB_TRX' 
2017-02-24T16:04:40.344978Z 0 [Note] Shutting down plugin 'InnoDB' 
2017-02-24T16:04:40.345065Z 0 [Note] InnoDB: FTS optimize thread exiting. 
2017-02-24T16:04:40.345135Z 0 [Note] InnoDB: Starting shutdown... 
2017-02-24T16:04:40.445348Z 0 [Note] InnoDB: Dumping buffer pool(s) to /afs/crc.nd.edu/user/j/jlai1/MySQL/data/ib_buffer_pool 
2017-02-24T16:04:40.447661Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 170224 11:04:40 
2017-02-24T16:04:41.779942Z 0 [Note] InnoDB: Shutdown completed; log sequence number 2534618 
2017-02-24T16:04:41.795993Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1" 
2017-02-24T16:04:41.796030Z 0 [Note] Shutting down plugin 'MEMORY' 
2017-02-24T16:04:41.796045Z 0 [Note] Shutting down plugin 'CSV' 
2017-02-24T16:04:41.796092Z 0 [Note] Shutting down plugin 'sha256_password' 
2017-02-24T16:04:41.796105Z 0 [Note] Shutting down plugin 'mysql_native_password' 
2017-02-24T16:04:41.796375Z 0 [Note] Shutting down plugin 'binlog' 
2017-02-24T16:04:41.796973Z 0 [Note] ./bin/mysqld: Shutdown complete 

回答

1

問題似乎是您的用戶沒有權限綁定端口,3306專門用於Mysql。

+1

解決方法是通過'sudo'以特權用戶身份啓動MySQL。 – ceejayoz

+0

正如我在問題中提到的,我沒有HPC中的root權限。有什麼辦法可以解決這個問題嗎?或者,我應該如何讓MySQL在沒有root權限的情況下工作? –

相關問題