質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
MySQL

MySQL(マイエスキューエル)は、TCX DataKonsultAB社などが開発するRDBMS(リレーショナルデータベースの管理システム)です。世界で最も人気の高いシステムで、オープンソースで開発されています。MySQLデータベースサーバは、高速性と信頼性があり、Linux、UNIX、Windowsなどの複数のプラットフォームで動作することができます。

iOS

iOSとは、Apple製のスマートフォンであるiPhoneやタブレット端末のiPadに搭載しているオペレーションシステム(OS)です。その他にもiPod touch・Apple TVにも搭載されています。

SQL

SQL(Structured Query Language)は、リレーショナルデータベース管理システム (RDBMS)のデータベース言語です。大きく分けて、データ定義言語(DDL)、データ操作言語(DML)、データ制御言語(DCL)の3つで構成されており、プログラム上でSQL文を生成して、RDBMSに命令を出し、RDBに必要なデータを格納できます。また、格納したデータを引き出すことも可能です。

teratail

teratail(テラテイル)は、プログラミングに特化した日本語Q&Aサイトです。

Q&A

0回答

810閲覧

my.cnf.をios版で、変更する方法=>[mysql]パスワードなしでsqlを実行したいです。

taiyo.pro.pytho

総合スコア1

MySQL

MySQL(マイエスキューエル)は、TCX DataKonsultAB社などが開発するRDBMS(リレーショナルデータベースの管理システム)です。世界で最も人気の高いシステムで、オープンソースで開発されています。MySQLデータベースサーバは、高速性と信頼性があり、Linux、UNIX、Windowsなどの複数のプラットフォームで動作することができます。

iOS

iOSとは、Apple製のスマートフォンであるiPhoneやタブレット端末のiPadに搭載しているオペレーションシステム(OS)です。その他にもiPod touch・Apple TVにも搭載されています。

SQL

SQL(Structured Query Language)は、リレーショナルデータベース管理システム (RDBMS)のデータベース言語です。大きく分けて、データ定義言語(DDL)、データ操作言語(DML)、データ制御言語(DCL)の3つで構成されており、プログラム上でSQL文を生成して、RDBMSに命令を出し、RDBに必要なデータを格納できます。また、格納したデータを引き出すことも可能です。

teratail

teratail(テラテイル)は、プログラミングに特化した日本語Q&Aサイトです。

0グッド

0クリップ

投稿2021/02/28 09:44

前提・実現したいこと

前提=>

mysql -u root -p 2. brew services start mysql@5.7 3. mysql --user=root --password 4. exit; brew services stop mysql@5.7

このコマンドを実行して、パスワードを挿入すればうまくいきます。(順番は、バラバラですが、)
はいったり、でたり、ログインは、せいじょうにできます。
これらをもとに、
実現したいこと=>

mysql -u root

このコードで、パスなしで、実行したいです。

■■な機能を実装中に以下のエラーメッセージが発生しました。

発生している問題・エラーメッセージ

(base) SN:~ SN$ mysql -u root ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

該当のソースコード

簡略=> (base) SN:~ SN$ mysql -u root ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

本家>

The default interactive shell is now zsh. To update your account to use zsh, please run `chsh -s /bin/zsh`. For more details, please visit https://support.apple.com/kb/HT208050. (base) SN:reason SN$ (base) SN:reason SN$ sudo npm install -g npm Password: /usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npx -> /usr/local/lib/node_modules/npm/bin/npx-cli.js + npm@7.6.0 added 58 packages from 25 contributors, removed 240 packages and updated 195 packages in 5.186s (base) SN:reason SN$ npm init This utility will walk you through creating a package.json file. It only covers the most common items, and tries to guess sensible defaults. See `npm help init` for definitive documentation on these fields and exactly what they do. Use `npm install <pkg>` afterwards to install a package and save it as a dependency in the package.json file. Press ^C at any time to quit. package name: (reason) sudo npm install exercise --save Sorry, name can only contain URL-friendly characters. package name: (reason) npm install --global alfred-emoj Sorry, name can only contain URL-friendly characters. package name: (reason) npm WARN init canceled (base) SN:reason SN$ npm install --global alfred-emoj added 203 packages, and audited 204 packages in 6s 6 packages are looking for funding run `npm fund` for details found 0 vulnerabilities (base) SN:reason SN$ ls __pycache__ block_chain.py cache.db data.pickle pyblockchain_src taiyo.game.1 test_sqlite2 utils.py (base) SN:reason SN$ npm install --global alfred-emoj changed 203 packages, and audited 204 packages in 5s 6 packages are looking for funding run `npm fund` for details found 0 vulnerabilities (base) SN:reason SN$ npm install --global alfred-emoj changed 203 packages, and audited 204 packages in 5s 6 packages are looking for funding run `npm fund` for details found 0 vulnerabilities (base) SN:reason SN$ (base) SN:reason SN$ (base) SN:reason SN$ (base) SN:reason SN$ clear (base) SN:reason SN$ python Python 2.7.13 (default, Nov 30 2020, 10:46:24) [GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.42)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> >>> KeyboardInterrupt >>> ^D (base) SN:reason SN$ (base) SN:reason SN$ (base) SN:reason SN$ python cal_test.py /Applications/MAMP/Library/bin/python: can't open file 'cal_test.py': [Errno 2] No such file or directory (base) SN:reason SN$ python3 cal_test.py python3: can't open file 'cal_test.py': [Errno 2] No such file or directory (base) SN:reason SN$ ls __pycache__ block_chain.py cache.db data.pickle pyblockchain_src taiyo.game.1 test_sqlite2 utils.py (base) SN:reason SN$ cd (base) SN:~ SN$ brew services start mysql@5.7 ==> Successfully started `mysql@5.7` (label: homebrew.mxcl.mysql@5.7) (base) SN:~ SN$ mysql --user=root --password Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 9 Server version: 8.0.23 Homebrew Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> ps aux| grep mysqld -> -> service mysql stop -> ^DBye (base) SN:~ SN$ service mysql stop bash: service: command not found (base) SN:~ SN$ mysql --user=root --password Enter password: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) (base) SN:~ SN$ ps aux| grep mysqld SN 18434 0.0 0.0 4399480 792 s000 S+ 5:03PM 0:00.00 grep mysqld SN 15346 0.0 0.6 5787484 391644 ?? S 4:37PM 0:02.62 /usr/local/opt/mysql/bin/mysqld --basedir=/usr/local/opt/mysql --datadir=/usr/local/var/mysql --plugin-dir=/usr/local/opt/mysql/lib/plugin --log-error=SN.local.err --pid-file=SN.local.pid SN 15247 0.0 0.0 4282296 1248 ?? S 4:37PM 0:00.02 /bin/sh /usr/local/opt/mysql/bin/mysqld_safe --datadir=/usr/local/var/mysql (base) SN:~ SN$ kill -9 18434 bash: kill: (18434) - No such process (base) SN:~ SN$ kill -9 15346 (base) SN:~ SN$ kill -9 15247 (base) SN:~ SN$ mysql -u root ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) (base) SN:~ SN$ (base) SN:~ SN$ mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 9 Server version: 8.0.23 Homebrew Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> ALTER USER test_user IDENTIFIED WITH mysql_native_password BY 'password'; ERROR 1396 (HY000): Operation ALTER USER failed for 'test_user'@'%' mysql> use mysql Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> UPDATE user SET authentication_string=password('53007Sii') WHERE user='root'; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '('53007Sii') WHERE user='root'' at line 1 mysql> select password('Passwordpass3!') -> mysqld_safe --user=mysql --skip-grant-tables --skip-networking -> -> -> -> ALTER USER root@localhost IDENTIFIED BY '53007Sii'; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '('Passwordpass3!') mysqld_safe --user=mysql --skip-grant-tables --skip-networkin' at line 1 mysql> exit; Bye (base) SN:~ SN$ mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 15 Server version: 8.0.23 Homebrew Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> ALTER USER root@localhost IDENTIFIED BY '53007Sii'; Query OK, 0 rows affected (0.01 sec) mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) mysql> quit Bye (base) SN:~ SN$ sudo systemctl restart mysqld.service Password: sudo: systemctl: command not found (base) SN:~ SN$ sudo mysql.server restart Password: Shutting down MySQL .. SUCCESS! Starting MySQL .2021-02-28T09:10:32.6NZ mysqld_safe A mysqld process already exists SUCCESS! (base) SN:~ SN$ mysql -u root ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) (base) SN:~ SN$ (base) SN:~ SN$

試したこと

1,
最初は、このエラーです。

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '('Passwordpass3!') where user = 'root'' at line 1

2,
それで、こちらのサイトを参考に、こちら
したら、appdataで、パスワードを新規作成する必要がある、(root)だから?
それで、aapdataの最後の方にかかれてる、これを、実行

ALTER USER root@localhost IDENTIFIED BY '新しいパスワード';

4,
でも、実行できなかったので、バージョンがあってないだってことで、
リンク内容
こちらの記事で、おこなって、上手く行ったのですが、iosバージョンではないので、
my.cnfファイルにうまく反映されてないっぽいです。
後、再起動もコマンドも違ったので、
5,それで、うまくいくのか、やってみたら、ごらんのとおりです。 
*

補足情報(FW/ツールのバージョンなど)

(macbookpro,11.2.1)
間違った解釈でしたら、すいません。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

tanat

2021/02/28 22:29

> my.cnf.をios版 > (macbookpro,11.2.1) ios版では無くて、macOS版ですかね? であれば、タイトルを変更された方が適切な回答が得られるかと思いますよ。 (iosで動くMySQLが存在していたらごめんなさい)
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問