Stackoverflow.
I am struggling for a past couple of days to install mySQL on my raspberry pi 2 :/
I am not Debian 7 (Wheezy) and there is no way I can change the distribution, have to work with that. So, i need to install MySQL version 5.5 or greater, or MariaDB and i have tried installing both, but none works.
When installing MariaDB, following their documentation, when i get to the point
sudo apt-get install mariadb-server
Am getting an error:
The following packages have unmet dependencies:
mariadb-server : Depends: mariadb-server-10.0 (= 10.0.32+maria-1~wheezy) but it is not installable
Tried googling and looking for similar cases, but can't find anything which would work.
With mySQL things are even worst. Using their documentation and MySQL APT Repository and tutorials doing following steps:
wget https://dev.mysql.com/get/mysql-apt-config_0.8.8-1_all.deb
dpkg -i mysql-apt-config_0.8.8-1_all.deb (choosing mysql 5.6)
apt-get update
It shows error:
apt-get update
Hit http://mirror.zol.co.zw wheezy Release.gpg
Hit http://mirror.zol.co.zw wheezy Release
Hit http://mirror.zol.co.zw wheezy/main Sources
Hit http://mirror.zol.co.zw wheezy/main amd64 Packages
Hit http://mirror.zol.co.zw wheezy/main i386 Packages
Ign http://mirror.zol.co.zw wheezy/main Translation-en_GB
Ign http://mirror.zol.co.zw wheezy/main Translation-en
Hit http://archive.raspberrypi.org wheezy Release.gpg
Hit http://raspberrypi.collabora.com wheezy Release.gpg
Hit http://raspberrypi.collabora.com wheezy Release
Get:1 http://repo.mysql.com wheezy Release.gpg [173 B]
Hit http://archive.raspberrypi.org wheezy Release
Hit http://raspberrypi.collabora.com wheezy/rpi armhf Packages
Hit http://archive.raspberrypi.org wheezy/main armhf Packages
Get:2 http://repo.mysql.com wheezy Release [24.1 kB]
Get:3 http://repo.mysql.com wheezy/mysql-5.6 Sources [859 B]
Ign http://raspberrypi.collabora.com wheezy/rpi Translation-en_GB
Ign http://raspberrypi.collabora.com wheezy/rpi Translation-en
Ign http://archive.raspberrypi.org wheezy/main Translation-en_GB
Ign http://archive.raspberrypi.org wheezy/main Translation-en
Fetched 25.2 kB in 5s (4,900 B/s)
W: Failed to fetch http://repo.mysql.com/apt/debian/dists/wheezy/Release Unable to find expected entry 'mysql-apt-config/binary-armhf/Packages' in Release file (Wrong sources.list entry or malformed file)
E: Some index files failed to download. They have been ignored, or old ones used instead.
And if i try:
apt-get install mysql-community-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package mysql-community-server
Please help, any help would be very appreciated!
There doesn't seem to be any package in official debian repo in the name mysql-community-server. I found mysql-server package instead.
https://packages.debian.org/wheezy/mysql-server.
So try this:
Add official debian repo to your sources list (i.e. add deb http://security.debian.org/debian-security wheezy/updates main to the file /etc/apt/sources.list)
sudo apt-get update
sudo apt-get install mysql-server
Supporting a legacy app written in rails 2.3 and ruby 1.8.7
Upgraded from OS X 10.9 to 10.11 1-2 months ago without issue, have RVM installed (rvm 1.26.11 (latest)), had MySQL 5.6.10 installed via brew, legacy app had mysql gem working in its gemset.
Attempting to get an anaconda2 project working mysql library files were not being found, and I uninstalled via brew an older version while troubleshooting (non 5.6.10) and afterwards all rails applications no longer were able to start (missing mysql dependencies).
I could not get anything working with brew, and after cleaning up all warnings using brew doctor I still wasn't able to get MySQL running (server) so I decided to start over.
Uninstalled brew using ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
Re-installed MySQL using http://downloads.mysql.com/archives/get/file/mysql-5.6.27-osx10.9-x86_64.dmg
Was able to get data re-imported into server and mysql client connecting correctly from terminal.
At some point during troubleshooting I had uninstalled mysql via gem uninstall mysql and now trying to re-install the gem I get the following error:
kh#MBP ~/c/main/code/rails/main % gem install mysql --no-ri --no-rdoc -- --with-mysql-config='/usr/local/mysql/bin/mysql_config'
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/Users/kh/.rvm/rubies/ruby-1.8.7-head/bin/ruby extconf.rb --with-mysql-config=/usr/local/mysql/bin/mysql_config
checking for mysql_ssl_set()... no
checking for rb_str_set_len()... no
checking for rb_thread_start_timer()... no
checking for mysql.h... no
checking for mysql/mysql.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/kh/.rvm/rubies/ruby-1.8.7-head/bin/ruby
--with-mysql-config
Gem files will remain installed in /Users/kh/.rvm/gems/ruby-1.8.7-head#ruby-187/gems/mysql-2.9.1 for inspection.
Results logged to /Users/kh/.rvm/gems/ruby-1.8.7-head#ruby-187/gems/mysql-2.9.1/ext/mysql_api/gem_make.out
All the MySQL files appear to be in the correct places:
kh#MBP ~/c/main/code/rails/main % ls -l /usr/local/mysql
lrwxr-xr-x 1 kh staff 27 Mar 18 15:48 /usr/local/mysql -> mysql-5.6.27-osx10.8-x86_64
kh#MBP ~/c/main/code/rails/main % ls -l /usr/local/mysql/bin/*mysql*
-rwxr-xr-x 1 kh staff 1551 Sep 18 2015 /usr/local/mysql/bin/msql2mysql
-rwxr-xr-x 1 kh staff 4750576 Sep 18 2015 /usr/local/mysql/bin/mysql
-rwxr-xr-x 1 kh staff 4838512 Sep 18 2015 /usr/local/mysql/bin/mysql_client_test
-rwxr-xr-x 1 kh staff 16355200 Sep 18 2015 /usr/local/mysql/bin/mysql_client_test_embedded
-rwxr-xr-x 1 kh staff 6425 Sep 18 2015 /usr/local/mysql/bin/mysql_config
Any help would be appreciated.
I was able to solve this issue by removing these RVM rubies/gems, upgrading RVM, and recompiling ruby 1.8.7 and re-installing all my gems. Seems like a migration to el capitan issue with an old version of RVM masquerading as a specific mysql issue.
I'm getting the following error on my chrome console:
GET http://localhost/grunt/vendor/angular/angular.js net::ERR_CONTENT_LENGTH_MISMATCH
This only happens when a simultaneous requests are shot towards nginx e.g. when the browsers cache is empty and the whole app loads. Loading the resource above as a single requests succeeds.
Here are the headers to this requests, copied from Chrome:
Remote Address:127.0.0.1:80
Request URL:http://localhost/grunt/vendor/angular/angular.js
Request Method:GET
Status Code:200 OK
Request Headersview source
Accept:*/*
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8,de;q=0.6,pl;q=0.4,es;q=0.2,he;q=0.2,gl;q=0.2
Cache-Control:no-cache
Connection:keep-alive
Cookie:gs_u_GSN-265185-D=1783247335:2567:5000:1377697930719
Host:localhost
Pragma:no-cache
Referer:http://localhost/grunt/
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.122 Safari/537.36
Response Headersview source
Accept-Ranges:bytes
Cache-Control:public, max-age=0
Connection:keep-alive
Content-Length:873444
Content-Type:application/javascript
Date:Tue, 23 Sep 2014 11:08:19 GMT
ETag:"873444-1411465226000"
Last-Modified:Tue, 23 Sep 2014 09:40:26 GMT
Server:nginx/1.6.0
the real size of the file:
$ ll vendor/angular/angular.js
-rw-rw-r-- 1 xxxx staff 873444 Aug 30 07:21 vendor/angular/angular.js
As you can see Content-Length and the real size of the file are the same, so that's weird
And the nginx configuration to this proxy:
location /grunt/ {
proxy_pass http://localhost:9000/;
}
Any ideas?
Thanks
EDIT: found more info on the error log:
2014/09/23 13:08:19 [crit] 15435#0: *8 open() "/usr/local/var/run/nginx/proxy_temp/1/00/0000000001" failed (13: Permission denied) while reading upstream, client: 127.0.0.1, server: localhost, request: "GET /grunt/vendor/angular/angular.js HTTP/1.1", upstream: "http://127.0.0.1:9000/vendor/angular/angular.js", host: "localhost", referrer: "http://localhost/grunt/"
Adding the following line to the nginx config was the only thing that fixed the net::ERR_CONTENT_LENGTH_MISMATCH error for me:
proxy_buffering off;
It seems that under pressure, nginx tried to pull angular.js from its cache and couldn't due to permission issues. Here's what solved this issue:
root#amac-2:/usr/local/var/run/nginx $ chown -R _www:admin proxy_temp
_www:admin might be different in your case, depending which user owns the nginx process. See more information on ServerFault:
https://serverfault.com/questions/534497/why-do-nginx-process-run-with-user-nobody
I tried all of the above and still couldn't get it to work. Even after resorting to chmod 777. The only thing that solved it for me was to disable caching entirely:
proxy_max_temp_file_size 0;
Whilst not a fix and no good for production use this was OK for me since I'm only using nginx as part of a local development setup.
For me the remedy were these two settings:
In the file:
/etc/nginx/nginx.conf
Add:
proxy_max_temp_file_size 0;
proxy_buffering off;
Between the lines client_max_body_size 128M; and server_names_hash_bucket_size 256;:
http {
client_max_body_size 128M;
proxy_max_temp_file_size 0;
proxy_buffering off;
server_names_hash_bucket_size 256;
ps aux | grep "nginx: worker process"
after executing above command you'll see the user through which nginx is running
eg.
www-data 25356 0.0 0.0 68576 4800 ? S 12:45 0:00 nginx: worker process
www-data 25357 0.0 0.0 68912 5060 ? S 12:45 0:00 nginx: worker process
now you have to run below command to give permission
chown -R www-data:www-data /var/lib/nginx/
Hope it will work
For us, it turned out to be that our server's rather small root (ie. /) was full.
It had mountains of logs and files from users in /home. Moving all that cruft out to another mounted drive solved things.
Just wanted to share as this can be another cause of the problem.
If somebody ran nginx as a different user in the past, ownership of cache folder may be twisted. I got
/var/cache/nginx# LANG=C ls -l proxy_temp/
total 40
drwx------ 18 nginx nginx 4096 Jul 14 2016 0
drwx------ 19 nginx nginx 4096 Jul 14 2016 1
drwx------ 19 nginx nginx 4096 Jul 14 2016 2
drwx------ 19 nginx nginx 4096 Jul 14 2016 3
drwx------ 19 nginx nginx 4096 Jul 14 2016 4
drwx------ 19 nginx nginx 4096 Jul 14 2016 5
drwx------ 19 nginx nginx 4096 Jul 14 2016 6
drwx------ 18 nginx nginx 4096 Jul 14 2016 7
drwx------ 18 nginx nginx 4096 Jul 14 2016 8
drwx------ 18 nginx nginx 4096 Jul 14 2016 9
while nginx was running as www-data. So the solution is to change ownership of nginx’s cache directory to the user nginx is running under. In the present case
/var/cache/nginx# chown -R www-data:www-data *
or, even simpler
# rm -r /var/cache/nginx/*
What worked for me was to change the proxy_temp_path to a folder with read/write permissions (777)
location / {
proxy_temp_path /data/tmp;
}
I had same issue.
Increasing the space of Directory or Folder where nginx is installed, solved the issue.
For macOS with nginx installed with homebrew, I used the following steps to track down and fix the issue.
Run nginx -h to find your error log location. Look for the following line:
-e filename : set error log file (default: /opt/homebrew/var/log/nginx/error.log)
Take your error log path and tail it to see what error it's reporting when you try to load the page.
tail -f /opt/homebrew/var/log/nginx/error.log
From that I saw that one of the lines showed a permission denied error:
open() "/opt/homebrew/var/run/nginx/proxy_temp/9/01/0000000019" failed (13: Permission denied) while reading upstream
Which means that your cached directories have incorrect permissions for the nginx user.
Stop nginx
brew services stop nginx
Delete all the temp folders (location from the permission error log line)
sudo rm -rf /opt/homebrew/var/run/nginx/*
Start nginx again
brew services start nginx
After doing this, nginx will recreate the temp folders with the correct permissions. At this point you should be good try and reload your page that was failing before.
When I tried the aforementioned solution it didn't fix the issue. I also changed the permission to write on the location but it didn't work. Then I realized I did something wrong in there. In the location to store the file, I had something like
"/storage" + fileName + ".csv"
. I was testing on the Windows environment and it was working great. But later when we moved the application to the Linux environment it stopped working. So later I had to change it to
"./storage" + fileName + ".csv"
and it started working normally.
For me, the solution was:
sudo chown -R nginx:nginx /var/cache/nginx/fastcgi_temp/
For anyone using HAProxy as proxy and getting these exact same symptoms, increasing the timeout values resolved the issue for me:
timeout connect 5000
timeout client 50000
timeout server 50000
The only thing that helped me was the following settings in nginx site .conf file:
proxy_read_timeout 720s;
proxy_connect_timeout 720s;
proxy_send_timeout 720s;
For me I had the same error except on a
different folder /var/lib/nginx/.
I changed the owner to nginx by
chown -R nginx:nginx /var/lib/nginx/. That did not work.
Then I checked who owned the nginx worker process by
ps aux| grep nginx
And it was running as nginx but when I looked through the nginx.conf file; I found that the user was nginx but it did not have any group. So, I added nginx to the user nginx; it turned out like this
user nginx nginx
Now I rebooted the system and the issue was fixed. I suppose I could have just used
chown -R nginx /var/lib/nginx/
That may have worked as well. So if anyone is facing this issue; firstly go into var/log/nginx and
check where the permission error occurred.
I'm trying to install MySQL 5.6 community edition from the RPM package I downloaded. I'm running on cloudera's CDH 4.5 virtual machine, which is CentOS 6.4. The VM came with MySQL 5.1.73 installed, the old versions of files seem to be blocking me from updating.
I already did this:
sudo yum remove mysql
and that worked just fine, without a problem. Then I deleted everything in /usr/lib/mysql, aka the data directory. So then I tried installing the new version:
[cloudera#localhost mysql]$ pwd
/home/cloudera/mysql
[cloudera#localhost mysql]$ ll
total 302660
-rw-r--r-- 1 cloudera cloudera 23080383 Mar 17 02:39 MySQL-client-5.6.17-1.linux_glibc2.5.x86_64.rpm
-rw-r--r-- 1 cloudera cloudera 4573735 Mar 17 02:40 MySQL-devel-5.6.17-1.linux_glibc2.5.x86_64.rpm
-rw-r--r-- 1 cloudera cloudera 114192347 Mar 17 02:40 MySQL-embedded-5.6.17-1.linux_glibc2.5.x86_64.rpm
-rw-r--r-- 1 cloudera cloudera 86961692 Mar 17 02:41 MySQL-server-5.6.17-1.linux_glibc2.5.x86_64.rpm
-rw-r--r-- 1 cloudera cloudera 2398671 Mar 17 02:41 MySQL-shared-5.6.17-1.linux_glibc2.5.x86_64.rpm
-rw-r--r-- 1 cloudera cloudera 5180653 Mar 17 02:41 MySQL-shared-compat-5.6.17-1.linux_glibc2.5.x86_64.rpm
-rw-r--r-- 1 cloudera cloudera 73530987 Mar 17 02:42 MySQL-test-5.6.17-1.linux_glibc2.5.x86_64.rpm
[cloudera#localhost mysql]$ sudo yum install MySQL-server-5.6.17-1.linux_glibc2.5.x86_64.rpm
.....
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Check Error:
file /usr/share/mysql/charsets/README from install of MySQL-server-5.6.17-1.linux_glibc2.5.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/czech/errmsg.sys from install of MySQL-server-5.6.17-1.linux_glibc2.5.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
......
So it looks like the old installation is blocking me, I tried to delete mysql-libs but...
[cloudera#localhost mysql]$ sudo yum remove mysql-libs
.....
pig noarch 0.11.0+33-1.cdh4.4.0.p0.14.el6 #cloudera-cdh4 120 M
postfix x86_64 2:2.6.6-2.2.el6_1 #anaconda-CentOS-201112091719.x86_64/6.2 9.7 M
redhat-lsb x86_64 4.0-7.el6.centos #base 0.0
redhat-lsb-compat x86_64 4.0-7.el6.centos #base 0.0
redhat-lsb-core x86_64 4.0-7.el6.centos #base 22 k
redhat-lsb-graphics x86_64 4.0-7.el6.centos #base 0.0
redhat-lsb-printing x86_64 4.0-7.el6.centos #base 0.0
solr noarch 4.4.0+69-1.cdh4.3.0.p0.4.el6 #cloudera-search 66 M
solr-mapreduce noarch 1.0.0-1.cdh4.3.0.p0.5.el6 #cloudera-search 55 M
sqoop noarch 1.4.3+62-1.cdh4.4.0.p0.15.el6 #cloudera-cdh4 7.7 M
sqoop2 noarch 1.99.2+85-1.cdh4.4.0.p0.62.el6 #cloudera-cdh4 7.8 M
sysstat x86_64 9.0.4-20.el6 #base 807 k
tomcat noarch 7.0.33-3.el6 #epel 303 k
Transaction Summary
=============================================================================================================================================================================================
Remove 67 Package(s)
It went and listed a lot of major software that depends on mysql-libs. I don't want to reinstall tomcat, pig, hive, mahout, hue, oozie, flume, and cloudera manager. I have worked with those before, I know that they are a NIGHTMARE to get installed and configured correctly, so I really don't want to uninstall those.
So I thought maybe I should try an update instead,
[cloudera#localhost mysql]$ sudo yum update MySQL-server-5.6.17-1.linux_glibc2.5.x86_64.rpm
....
Examining MySQL-server-5.6.17-1.linux_glibc2.5.x86_64.rpm: MySQL-server-5.6.17-1.linux_glibc2.5.x86_64
Package MySQL-server not installed, cannot update it. Run yum install to install it instead.
No Packages marked for Update
It will not let me update it because I already removed it.
Would somebody please tell me how to install MySQL from these RPMs without uninstalling everything else?
Try to install shared-compat packages as you can see here.
I'm just going to re-write the answer for anybody else who comes across this.
Download the mysql yum repo if you don't already have it: http://dev.mysql.com/downloads/file.php?id=450542
If you have an old version of mysql installed, just do a yum update mysql. You may also need to do yum update mysql-server.
If you uninstalled it, try to reinstall now that you have the new yum repo. If it still fails due to a Transaction check error, try deleting any files that it lists in conflict. Be careful not to delete any files you want to keep.
you may also need to do 'sudo yum update mysql-server' or 'sudo yum install mysql-server'. I did.
I will mark acfrai's answer correct to give him credit, he helped lead me to this information.
Trying to back out of a macports mysql installation and return to Snow Leopard Server's built-in MySQL server, but I cannot get it to work.
When I disable macports and enable the built-in service, mysql.sock cannot be found (locate mysql.sock returns nothing). When I re-enable the macport mysql, mysql.sock is found but now I cannot disable the built-in MySQL service.
Every time I try, it just re-enables it.
I have to run the following commands to get MacPorts MySQL to work upon reboots:
sudo launchctl unload -w /Library/LaunchDaemons/org.macports.mysql5.plist
sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist
ln -s /var/mysql/mysql.sock /tmp/mysql.sock
Permissions on /var/mysql are (which is where the built-in service is set to):
drwxr-xr-x 111 _mysql _mysql
Permissions on the macports datadir are:
drwxr-xr-x 116 _mysql _mysql
At one time, according to the access log file for the built-in mysql, it started up correctly (2010). Is there a way to manually disable this service from starting up when I reboot?
I realize how unclear my problem is, but somehow the previous admin got macports mysql tied in with the built-in mysql and I'm having a heck of a time untangling them.
In /Library/LaunchDaemons/ plist-files of the installed applications are located, here's what I have there:
$ ls -l /Library/LaunchDaemons/
-r--r--r-- 1 root wheel 573 Jan 10 18:33 at.obdev.littlesnitchd.plist
-rw-r--r-- 1 root wheel 567 Mar 5 19:02 com.parallels.desktop.launchdaemon.plist
lrwxr-xr-x 1 root admin 74 Jan 20 06:21 org.macports.mysql5.plist -> /opt/local/etc/LaunchDaemons/org.macports.mysql5/org.macports.mysql5.plist
lrwxr-xr-x 1 root admin 74 Oct 14 2011 org.macports.rsyncd.plist -> /opt/local/etc/LaunchDaemons/org.macports.rsyncd/org.macports.rsyncd.plist
And if you'd like to check the MacOS bundled services' config, take a look at /System/Library/LaunchDaemons/.