Ubuntu Server Guide Changes, errors and bugs
Download 1.27 Mb. Pdf ko'rish
|
ubuntu-server-guide
- Bu sahifa navigatsiya:
- Installation
- Configuration
Databases
Ubuntu provides two popular database servers. They are: • MySQL • PostgreSQL Both are popular choices among developers, with similar feature sets and performance capabilities. Histor- ically, Postgres tended to be a preferred choice for its attention to standards conformance, features, and extensibility, whereas Mysql may be more preferred for higher performance requirements, however over time each has made good strides catching up with the other. Specialized needs may make one a better option for a certain application, but in general both are good, strong options. They are available in the main repository and equally supported by Ubuntu. This section explains how to install and configure these database servers. MySQL MySQL is a fast, multi-threaded, multi-user, and robust SQL database server. It is intended for mission- critical, heavy-load production systems and mass-deployed software. Installation To install MySQL, run the following command from a terminal prompt: sudo apt i n s t a l l mysql−s e r v e r 129 Once the installation is complete, the MySQL server should be started automatically. You can quickly check its current status via systemd: sudo s e r v i c e mysql s t a t u s � mysql . s e r v i c e − MySQL Community S e r v e r Loaded : l o a d e d ( / l i b / systemd / system / mysql . s e r v i c e ; e n a b l e d ; vendor p r e s e t : e n a b l e d ) A c t i v e : a c t i v e ( r u n ni n g ) s i n c e Tue 2019−10−08 1 4 : 3 7 : 3 8 PDT; 2 weeks 5 days ago Main PID : 2028 ( mysqld ) Tasks : 28 ( l i m i t : 4 9 1 5 ) CGroup : / system . s l i c e / mysql . s e r v i c e �� 2028 / u s r / s b i n / mysqld −−daemonize −−pid− f i l e =/run / mysqld / mysqld . p i d Oct 08 1 4 : 3 7 : 3 6 db . example . o r g systemd [ 1 ] : S t a r t i n g MySQL Community S e r v e r . . . Oct 08 1 4 : 3 7 : 3 8 db . example . o r g systemd [ 1 ] : S t a r t e d MySQL Community S e r v e r . The network status of the MySQL service can also be checked by running the ss command at the terminal prompt: sudo s s −tap | g r e p mysql When you run this command, you should see something similar to the following: LISTEN 0 151 1 2 7 . 0 . 0 . 1 : mysql 0 . 0 . 0 . 0 : * u s e r s : ( ( ” mysqld ” , p i d =149190 , f d =29) ) LISTEN 0 70 * : 3 3 0 6 0 * : * u s e r s : ( ( ” mysqld ” , p i d =149190 , f d =32) ) If the server is not running correctly, you can type the following command to start it: sudo s e r v i c e mysql r e s t a r t A good starting point for troubleshooting problems is the systemd journal, which can be accessed at the terminal prompt with this command: sudo j o u r n a l c t l −u mysql Configuration You can edit the files in /etc/mysql/ to configure the basic settings – log file, port number, etc. For example, to configure MySQL to listen for connections from network hosts, in the file /etc/mysql/mysql.conf.d/mysqld .cnf, change the bind-address directive to the server’s IP address: bind−a d d r e s s = 1 9 2 . 1 6 8 . 0 . 5 Note Replace 192.168.0.5 with the appropriate address, which can be determined via ip address show. After making a configuration change, the MySQL daemon will need to be restarted: sudo s y s t e m c t l r e s t a r t mysql . s e r v i c e 130 |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling