Ubuntu 14.04 installation, with nginx, passenger and postgresql. The following steps are run:
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install mysql-server
sudo mysql_secure_installation _for allowing only localhost connection_
sudo apt-get install sphinxsearch
gem file has
gem 'mysql2', '0.3.18', :platform => :ruby
gem 'thinking-sphinx', '3.1.4'
thinking_sphinx.yml specifies
mysql41: 9312
Running:
RAILS_ENV=development bundle exec rake ts:rebuild
proceeds correctly: total 112 writes, 0.079 sec, 485.0 kb/call avg, 0.7 msec/call avg Started searchd successfully (pid: 21644).
netstat -ltnp shows only one searchd process
tcp 0 0 127.0.0.1:9312 0.0.0.0:* LISTEN 21644/searchd
So one concludes that everything is a go... right? [nasty buzzer]
ThinkingSphinx::ConnectionError
Error connecting to Sphinx via the MySQL protocol.
Error connecting to Sphinx via the MySQL protocol. _nice... stated twice!_
Can't connect to MySQL server on '127.0.0.1' (111)
Possible avenues for non-connection:
mySql-server root password not digested
nginx somehow impeding the connection
others? how to verify/assert?
While Sphinx implements the MySQL protocol for querying, it does not pay any attention to authentication, so Thinking Sphinx doesn't use those fields either. So I'm not sure if mysql_secure_installation is the right tool for the job - certainly, not if it's trying to use authentication to control access. If you don't want to allow external communication to Sphinx, can you just block the port?
Building on Pat's observation the following got me running on Ubuntu 14.04 installation, with nginx, passenger and postgresql.
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install mysql-server
sudo apt-get install sphinx search
Ensure gem file has
gem 'mysql2', '0.3.18', :platform => :ruby
gem 'thinking-sphinx', '3.1.4'
# alternately with JRuby
gem 'jdbc-mysql', '~> 5.1.28', :platform => :jruby
thinking_sphinx.yml must specify
mysql41: [port_number]
multiple search processes need distinct ports.
Configure, index and start via:
RAILS_ENV=[your_environment] bundle exec rake ts:rebuild
sudo netstat -ltnp should show the listen port as defined in thinking_sphinx.yml and rendered in config/[your_environment].sphinx.conf
tcp 0 0 127.0.0.1:[port_number] 0.0.0.0:* LISTEN 21644/searchd
Finally,
sudo reboot
Related
I had installed MySQL in my Ubuntu OS PC. But during the config setup, I had mistakenly set Disallow root login to Y. The MySQL Workbench was not able to connect. I accessed the config file from the terminal prompt:
sudo nano /etc/mysql/mysql.conf.d/mysql.cnf
I noticed that it did not have any config. It only had the following lines:
#The MySQL client configuration file
#Refer to https://dev.mysql.com/doc/refman/en/mysql-command-options.html
[mysql]
I entered the line
bind_address = 0.0.0.0
password = mypassword
But still unable to connect MySQL Workbench. From the terminal, I was now unable to login to MySQL
I tried to uninstall MySQL and reinstall it with the following commands:
sudo apt-get remove --purge mysql*
sudo apt-get purge mysql*
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get remove dbconfig-mysql
sudo apt-get dist-upgrade
sudo apt-get install mysql-server
The last command did not proceed with the configuration. I had hoped that I will be able to set the Disallow root login to Y.
How do I uninstall/ reinstall MySQL and have MySQL Workbench connect to it.
Here's how I solved my problem First I uninstalled MySQL (again). Next, I decided to install XAMMP. I followed the how-to steps in one online resource. I launched the XAMPP and was able to connect to localhost/phpmyadmin. I was able to create a database and table, and add a record
In Ubuntu 18.04 server, I use binary file to install zabbix4.0 according to the official website document of zabbix4.0, and I use MySQL 5.7.30 database. After installation, when I configure the front end of zabbix4.0,In the database configuration page, I only see one option of PostgreSQL, not mysql, as shown in the following figure:
In my server, I have installed MySQL version 5.7.30, and imported the data of ZABBIX 4.0 into the ZABBIX database, without any PostgreSQL installed
Excuse me, how can I make zabbix4.0 support MySQL 5.7.30 that I have installed? Thank you!
I installed zabbix4.0 according to the official documents:
https://www.zabbix.com/documentation/4.0/zh/manual/installation/install_from_packages/debian_ubuntu
This is my installation method:
# install zabbix
cd ~/download
wget https://repo.zabbix.com/zabbix/4.0/ubuntu/pool/main/z/zabbix-
release/zabbix-release_ 4.0-2+bionic_ all.deb
sudo dpkg -i zabbix-release_ 4.0-2+bionic_ all.deb
sudo apt-get update
#install Server/proxy/
sudo apt-get install -y zabbix-server-mysql
sudo apt-get install -y zabbix-frontend-php
With Ubuntu, you got two type of databases when donwloading Zabbix, PostgreSql and MySql. You need to re-download (I mean installation and configuration) Zabbix choosing MySql as database.
The following link could help Zabbix (Ubuntu) with MySql as database
The current version of the package is 4.0-3, so instead, you must do this :
Install repository
# wget https://repo.zabbix.com/zabbix/4.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_4.0-3+bionic_all.deb
# sudo dpkg -i zabbix-release_4.0-3+bionic_all.deb
# sudo apt update
Install server, frontend, agent
# sudo apt install zabbix-server-mysql zabbix-frontend-php zabbix-agent
I have mariadb in my ubuntu system but it is not working properly , so i want to again install mysql in my system .
For Remove mariadb i have run these commands .
sudo apt-get --purge remove "mysql*"
sudo mv /etc/mysql/ /tmp/mysql_configs/
nano /etc/apt/sources.list
sudo apt-get update
sudo apt-get install mysql-server-5.6
but after step 5 it's give me these errors :
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
libmysqlclient18 : Depends: mysql-common (= 5.6.30-1ubuntu14.04)
mariadb-server-5.5 : Breaks: mysql-server-5.6
Breaks: virtual-mysql-server
mariadb-server-core-5.5 : Conflicts: mysql-server-5.6
mysql-server-5.6 : Depends: mysql-client-5.6 (>= 5.6.30-0ubuntu0.14.04.1)
Depends: mysql-server-core-5.6 (= 5.6.30-0ubuntu0.14.04.1)
Recommends: mysql-common-5.6 but it is not going to be installed
Breaks: virtual-mysql-server
W: Duplicate sources.list entry http://debian.datastax.com/community/ stable/main amd64 Packages (/var/lib/apt/lists/debian.datastax.com_community_dists_stable_main_binary-amd64_Packages)
W: Duplicate sources.list entry http://debian.datastax.com/community/ stable/main i386 Packages (/var/lib/apt/lists/debian.datastax.com_community_dists_stable_main_binary-i386_Packages)
W: You may want to run apt-get update to correct these problems
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
Can anyone give me suggestion how can i install mysql in my system . Thanks in advance .
First of all, you need to update the system.
sudo apt update && upgrade
then perform the MySQL installation commands and follow the instructions.
sudo apt install mysql-server
sudo mysql_secure_installation
Once it has done. try to open MySQL.
sudo mysql
try to check the authentication method each of your MySQL user accounts uses with the following command in the MySQL terminal:
SELECT user,authentication_string,plugin,host FROM mysql.user;
this will return users with authentication_string.
Change the MySQL root password with the following command.
ALTER USER 'root'#'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
FLUSH PRIVILEGES;
Flush Privileges which tells the server to reload the grant tables and put your new changes into effect
It's very simple to install mysql on ubuntu , just follow these steps :
Step 1 : update the system
sudo apt update
Step 2 : Install mysql package
sudo apt install mysql-server
Step 3 : Once the installation is completed, the MySQL service will start automatically. To check whether the MySQL server is running, type:
sudo systemctl status mysql
The output of the following command should be :
OUTPUT
mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2018-06-20 11:30:23 PDT; 5min ago
Main PID: 17382 (mysqld)
Tasks: 27 (limit: 2321)
CGroup: /system.slice/mysql.service
`-17382 /usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid
Step 4 : Securing MySQL
sudo mysql_secure_installation
select one of the three levels of password validation policy(strong recommended).Set your password ,and then type y(yes) to all the questions , this will improve the security .
Step 5 : Once it has done. open MySQL by typing the following command :
sudo mysql
Step 6 : If you want to login to your MySQL server as root from an external program such as phpMyAdmin , then type these commands inside mysql.
mysql>ALTER USER 'root'#'localhost' IDENTIFIED WITH mysql_native_password BY 'strong_password';
mysql>FLUSH PRIVILEGES;
mysql>exit;
After this you will be successfully able to run mysql , for this open terminal and type.
mysql -u root -p
Now type your password.
Congo! you are done with installing mysql.
Lesson from continuous deployment test. You MUST do this purge mysql-common. You CANNOT put mariadb and mysql in the same system, they want their own mysql-common and not sharing them. Which many other API wrapped around it to connect to those server.
And you must comment all the repo pointing to mariadb. Otherwise it will install the same version again from mariadb.
sudo apt-get purge mysql-common
# Put back the mysql-common , make sure you use the new mysql repo,
# remarks mariadb repo
sudo apt-get install software-properties-common
Always check whether any OTHER file or folder contains mariadb repo.
cd /etc/apt
fgrep -lR "maria"
The easy way for this is installing the synaptic package manager by typing the following command in the terminal:
sudo apt-get install synaptic
And then open synaptic by:
sudo synaptic
Then search for the package you have installed, mariadb, and mark it for complete removal and press apply.
And these commands to install mysql-server
sudo apt-get update
sudo apt-get install mysql-server
It's quite easy to install mysql on Ubuntu.
sudo apt-get update
sudo apt-get install mysql-server
You'll be asked to create a new password for root user. Set a good password and you're ready to go.
You can also follow this youtube videos for installation and basic understanding for Mysql
sudo apt-get update
sudo apt-get install mysql-server -y
if setup password
sudo mysql_secure_installation
if set new user
sudo mysql
>CREATE USER 'username'#'%' IDENTIFIED BY 'password';
>FLUSH PRIVILEGES;
>exit
sudo systemctl restart mysql
Fresh installation on Ubuntu. ran:
sudo apt-get update
sudo apt-get install mysql-client
sudo apt-get install sphinx search
RAILS_ENV=development bundle exec rake ts:configureruns properly, but when
RAILS_ENV=development bundle exec rake ts:index is invoked, all indices are returning
indexing index 'whatever_core'...
ERROR: index 'whatever_core': sql_connect: fe_sendauth: no password supplied
(DSN=pgsql://main:***#localhost:5432/same_development).
Thinking_sphinx.yml is configured as:
development:
bin_path: /usr/bin
pid_file: /home/main/same/shared/tmp/searchd.pid
configuration_file: /home/main/same/shared/config/development.sphinx.conf
indices_location: /home/main/same/shared/sphinx
use_64_bit: true
# enable_star: true
min_infix_len: 2
# max_matches: 1000
mysql41: 9313
mem_limit: 128M
utf8: true
this authentication has never been an issue previously... not sure what to make of it.
verify database.ymlthat it has proper username and password configuration.
I am trying to get some open source code running on my local machine. It uses mysql2, and I have not used this database before. I had some errors I was able to fix by running:
sudo apt-get install libmysql-ruby libmysqlclient-dev
I start up the rails server but when I go to http://localhost:3000/, I get the following error:
Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Do I need to start the MySQL server? How would I do that?
If you have your gem installed, start mysql before you run $ rails server
$ mysql.server start
To install MySql database:
sudo apt-get install mysql-server
To start MySql server:
/etc/init.d/mysql start
To stop MySql server:
/etc/init.d/mysql stop
To restart MySql server:
/etc/init.d/mysql restart
To check the status of MySql server:
/etc/init.d/mysql status
There is no mysql2 server. mysql2 is the name of a MySQL client gem (Ruby library). All you need is to install and start MySQL server.
It seems your server is Debian or Ubuntu. Execute apt-get install mysql-server to install MySQL. Your MySQL server will automatically start (by Upstart on Ubuntu or sysinit on Debian).
Just type command on terminal
/opt/lampp/lampp start if you have lamp server.Please let me know is it working for you,either I'll do other thing.