sudo vi /etc/mysql/my.cnf
[mysqld]
sql_mode = STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
sudo service mysql restart
sudo vi /etc/mysql/my.cnf
[mysqld]
sql_mode = STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
sudo service mysql restart
mysql_secure_installation
/var/log/mysqld.log
when trying to start MySQL:
[ERROR] Fatal error: mysql.user table is damaged. Please run mysql_upgrade.
ERROR: Zend_Db_Adapter_Exception: SQLSTATE[HY000] [2002] No such file or directory
Additionally, an exception has occurred while trying to report this error: Zend_Exception
No entry is registered for key 'translate' (Abstract.php:144)
MySQL 5.1 has been upgraded to 5.5 without running the «mysql_upgrade» command.
/etc/my.cnf
in a text editor. In this example we use the vi editor:
# vi /etc/my.cnf
2.2. Add «skip-grant-tables» on a new line under the [mysqld] section:
[mysqld]
skip-grant-tables
<…>
2.3. Save the changes and close the file.
# service mysqld start
OR
# service mysql start
# mysql_upgrade
/etc/my.cnf
file.# service mysqld restart
OR
# service mysql start
For over ways https://ruhighload.com/mysql+1045+access+denied+for+user
Note that with PostgreSQL 9.0 (and probably newer) on Mac OS 10.6.8 (and probably older), in order to prevent the PostgreSQL server from auto-starting, you have to:
/Library/LaunchDaemons/
com.edb.launchd.postgresql-9.0.plist
in an editor as root
(replace 9.0
with your correct version number), e.g. sudo vim com.edb.launchd.postgresql-9.0.plist
.<key>RunAtLoad</key>
<true/>
to <false/>
That should do it. Also, if you want to stop the server immediately, without restarting, su
to postgres
and run /Library/PostgreSQL/9.0/bin/pg_ctl stop -D<your data dir>
. You can find out which is your current data dir with ps aux|grep postgre
.
Source: http://forums.enterprisedb.com/posts/list/2240.page#8321
For example install MondoDB 2.6.12 on macOS Catalina
Download, extract and move:
wget http://downloads.mongodb.org/osx/mongodb-osx-x86_64-2.6.12.tgz
tar xzf mongodb-osx-x86_64-2.6.12.tgz
mv mongodb-osx-x86_64-2.6.12/ /usr/local/mongodb/
Add to file ~/.zshrc
this:
export PATH="$PATH:/usr/local/mongodb/bin"
PS: .bash_profile
or .profile
not worked in my case
Mkdir directory for data and set rights:
mkdir -p ~/data/db
chown -R mongodb.mongodb ~/data/db
Run MongoDB:
mongodb --dbpath ~/data/db
db.getSiblingDB('admin').runCommand({setParameter: 1, failIndexKeyTooLong: false})
use DB db.getCollectionNames().forEach(function(collection) { indexes = db[collection].getIndexes(); print("Indexes for " + collection + ":"); printjson(indexes); });
db.COLLECTION.dropIndexes() db.getCollectionNames().forEach(function(collection) { print("Indexes for " + collection + ":"); db[collection].dropIndexes(); }); db.getCollectionNames().forEach(function(collName) { db.runCommand({dropIndexes: collName, index: "*"}); });
rake db:mongoid:create_indexes RAILS_ENV=production
db.COLLECTION.getIndexes() db.getCollectionNames().forEach(function(collection){db[collection].reIndex()})
Your root
account, and this statement applies to any account, may only have been added with localhost access (which is recommended).
You can check this with:
SELECT host FROM mysql.userWHEREUser='root';
If you only see results with localhost
and 127.0.0.1
, you cannot connect from an external source. If you see other IP addresses, but not the one you’re connecting from — that’s also an indication.
You will need to add the IP address of each system that you want to grant access to, and then grant privileges:
CREATEUSER'root'@'ip_address' IDENTIFIED BY'some_pass';GRANTALL PRIVILEGES ON*.*TO'root'@'ip_address';
If you see %
, well then, there’s another problem altogether as that is «any remote source». If however you do want any/all systems to connect via root, use the %
wildcard to grant access:
CREATEUSER'root'@'%' IDENTIFIED BY'some_pass';GRANTALL PRIVILEGES ON*.*TO'root'@'%';
Finally, reload the permissions, and you should be able to have remote access:
FLUSH PRIVILEGES;
Following two steps worked perfectly fine for me:
Comment out the bind address from the file /etc/mysql/my.cnf
:
#bind-address = 127.0.0.1
Run following query in phpMyAdmin:
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'; FLUSH PRIVILEGES;
https://dev.mysql.com/doc/refman/5.7/en/update.html
UPDATE some_table SET field1='Value 1' WHERE primary_key = 7
UPDATE `Table A`,`Table B` SET `Table A`.`text`=concat_ws('',`Table A`.`text`,`Table B`.`B-num`," from ",`Table B`.`date`,'/')
UPDATE `table` SET `keywords` = concat_ws(', ',`keywords`,'main')
rpm -qa | grep mysql
find / -name mysql-community-libs-5.7.9-1.e17.x86_64
yum install mysql mysql-devel mysql-libs mysql-server php-mysql linode-longview perl-DBD-MySQL php-cli php-fpm php-gd php-imap php-ldap php-magickwand php-mbstring php-mcrypt php-mssql php-odbc php-pdo php-pear php-process php-shout php-snmp php-soap php-tidy php-xml php-xmlrpc php-common
PS may be problems without compat-mysql51-5.1.73-1.el6.remi.x86_64
Fix nessary indexes in code and recreate them:
rake db:mongoid:create_indexes RAILS_ENV=production
PS Before this I had to disable the errors when creating long indexes:
# mongo
MongoDB shell version:2.6.12
connecting to: test
> db.getSiblingDB('admin').runCommand({ setParameter:1, failIndexKeyTooLong:false})
Also may be needed reindex:
Also may be needed reindex:
db.getCollectionNames().forEach(function(collection){db[collection].reIndex()});
service redis-server start service mongodb start service ssh --full-restart source /usr/local/rvm/scripts/rvm
{ "bold_folder_labels": true, "caret_style": "phase", "color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme", "enable_tab_scrolling": false, "fade_fold_buttons": false, "fallback_encoding": "Cyrillic (Windows 1251)", "font_size": 13, "highlight_line": true, "highlight_modified_tabs": true, "ignored_packages": [ "RubyTest", "SublimeREPL", "Vintage" ], "line_padding_bottom": 1, "line_padding_top": 1, "show_encoding": true, "tab_size": 2, "translate_tabs_to_spaces": true, "update_check": false, "word_wrap": true }