プラグインをデータベースから無効化

これで探す


select * from wp_options where option_name = 'active_plugins'
 
 
// シリアライズされた文字列↓
$a='a:48:{i:0;s:25:"add-to-any/・・・・・・";}';

$b= unserialize($a);

array_splice($b,25,1);  //インデックスだと24を無効化
array_splice($b,13,1);  //〃 12
print_r($b);
$b = serialize($b);
var_dump($b); // 再度シリアライズして コピー
 
 
update wp_options
            -- ここに貼る ↓
set  option_value = 'i:0;s:23:"add-to-any/・・・・・・";}'
where option_name = 'active_plugins'
 

Ubuntu 18.04 LTS にMySQL Serverをインストール

Ubuntu 18.04にMySQL 5.7をインストールして、rootパスワードを変更するところまで。

インストール

aptでインストール

以前はインストール中にrootパスワードの入力画面が表示されていたと思いますが、
表示されなくなっていますね。

インストールした後、「mysql_secure_installation」を実行してrootの
パスワードを設定していきます。

エラーが出る場合は下の記事を参照
MySQLでmysqld.sockのエラーが出た

最初に「VALIDATE PASSWORD PLUGIN」を使用するかの確認です。
パスワードプラグインを使用して強固なパスワードを強制するか?

ローカル環境なので n でいい

Securing the MySQL server deployment.
Connecting to MySQL using a blank password.
VALIDATE PASSWORD PLUGIN can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD plugin?Press y|Y for Yes, any other key for No: n

rootのパスワードを設定します。

Please set the password for root here.
New password: [設定するパスワードを入力]
Re-enter new password: [設定するパスワードを再入力]
Estimated strength of the password: 100
Do you wish to continue with the password provided?(Press y|Y for Yes, an
y other key for No) : y

anonymousユーザーを削除するか。
利用しないのでyを選択しました。

By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production
environment.
Remove anonymous users? (Press y|Y for Yes, any other key for No) : ySuccess.

rootで外部から接続可能とするか。
「y」で接続不可としました。

Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y
Success.

デフォルトの「test」データベースを削除するか。
「y」で削除を選択しました。

By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production
environment.
Remove test database and access to it? (Press y|Y for Yes, any other key f
or No) : y
- Dropping test database...
Success.
- Removing privileges on test database...
Success.

テーブルをリロードするか。
「y」でリロードを実行しました。

Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
Success

起動する

rootでログインする

ログアウトする

 \q 

ubuntu18 mysql5.7 root password 設定

mysql5.7あたりからpasswordというフィールドは無くなっている

mysql> SELECT User , authentication_string FROM mysql.user
mysql> UPDATE user SET authentication_string=password('大文字と記号を含むパスワード') WHERE user='root';
mysql> flush privileges;
mysql> \q

# mysql-uroot -p

ちなみに ubuntuでrootユーザーでログインするとパスワードも聞かれずにログインできてしまう
$mysql -uroot -p
一般ユーザーならちゃんと聞かれる

MySQL rootのパスワードを忘れてしまった場合の対処方法

Dosプロンプトでディレクトリを変更

MySQLのrootのパスワードを忘れてしまった場合でも、以下の
対処をすることでパスワードの変更を行うことが出来ます。

(1)MySQLサービスの停止
●Windows
「コントロールパネル」→「管理コンソール」→「サービス」の画面を起動して、
「MySQL」サービスを停止してください。
●LINUX
以下のコマンドを実行して、デーモンを停止してください。
#/etc/init.d/mysql stop

(2)パスワード無しでログイン出来るようにMySQLを起動
●Windows
コマンドプロンプトを起動して以下のコマンドを実行してください。
mysqld-nt –skip-grant-tables
※応答待ちで止まりますが、そのままで問題ありません。

●LINUX
以下のコマンドを実行して、MySQLを起動してください。
#mysqld_safe –skip-grant-tables

(3)MySQLに接続して、パスワード変更
●Windows、LINUX共通
コマンドプロンプトをもう1つ起動させ、以下のコマンドでMySQLに接続、
及びパスワード変更コマンドを実行してください。
以下の画面はWindowsの物ですが、Linuxの場合も同じコマンドで変更できます。
なお、下記では新しいパスワードを「pass」で設定しています。
C:\Users\sasuke>mysql -u root mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.86-community-nt MySQL Community Edition (GPL)

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

mysql>update user set password=PASSWORD(‘pass’) where user=’root’ and host=’localhost’;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0

mysql>FLUSH PRIVILEGES;

(4)パソコンの再起動
パソコンの再起動、又はmysqlのプロセスを停止後にMySQLのサービスを起動しましょう。
上記で設定した新しいパスワードでログイン出来るようになります。

参考
http://sasuke.main.jp/mysqlrootpass.html

Amazon在庫 出品管理

amazonで無在庫販売を行うためのツールです。
国内のamazonと海外のamazonから取得したデータを取り込んで、 送料や手数料・利益率などを含んだ売価を計算します。
データ件数は数万件に対応しています、為替レートや利益率の調整、安すぎる売価の一括調整 と出品データの書出しができます。

このシステムにはamazonから商品データを取得する機能はありませんが、オプションで 設置することも可能です。
Amazon在庫 出品管理ツール

myslq 年齢計算 関数 文字連結

年月日が別々に記録されているフィールドをゼロづめにして、
連結して、
日付にキャストして、
今日の日付から引き算して、
年齢にする方法

SELECT
(YEAR(CURDATE()) - k.bthY) - (RIGHT(CURDATE(), 5) < RIGHT(cast(concat(k.bthY,lpad(k.bthM,2,'0'),lpad(k.bthD,2,'0')) as date), 5)) as '年齢'
FLOM table