PostgreSQL start/stop/restart(Mac)

$brew services start postgresql
$brew services stop postgresql
$brew services restart postgresql
Posted in Mac, PostgreSQL, 技術情報 | Leave a comment

Postgresql でユーザ作成

postgres=# create user ***_user with password '******';
CREATE ROLE
postgres=# grant all privileges on database ***_db to ***_user;
GRANT
Posted in PostgreSQL, 技術情報 | Leave a comment

postgres ユーザで操作する。

$ psql postgres
psql (14.8 (Homebrew))
Type "help" for help.

postgres=# 
Posted in PostgreSQL, 技術情報 | Leave a comment

PostgreSQL の再起動(Mac)

$ brew services restart postgresql
Warning: Formula postgresql was renamed to postgresql@14.
Stopping `postgresql@14`... (might take a while)
==> Successfully stopped `postgresql@14` (label: homebrew.mxcl.postgresql@14)
==> Successfully started `postgresql@14` (label: homebrew.mxcl.postgresql@14)
Posted in PostgreSQL, 技術情報 | Leave a comment

Dockerfile mysql:8.0

FROM mysql:8.0

ENV MYSQL_DATABASE=project \
  MYSQL_USER=root \
  MYSQL_PASSWORD=root \
  MYSQL_ROOT_PASSWORD=root \
  TZ=Asia/Tokyo

COPY my.cnf /etc/mysql/conf.d/my.cnf
RUN chmod 644 /etc/mysql/conf.d/my.cnf
Posted in 技術情報 | Leave a comment

Dockerfile python3.9-buster

FROM python:3.9-buster

COPY . /project/

RUN apt-get update -y
RUN apt-get install -y libmariadb-dev gcc libc-dev cron vim

WORKDIR /project/backend

RUN pip install --trusted-host pypi.python.org -r requirements.txt

#CMD ["uvicorn", "project:app", "--host", "0.0.0.0", "--reload"]

Posted in 技術情報 | Leave a comment

Python import / from の関係

Posted in 技術情報 | Leave a comment

Fatal error: require(): Failed opening required ‘C:\xampp\htdocs\ec-cube4\var\cache\prod/doctrine/orm/Proxies\__CG__EccubeEntityMasterWork.php’

EC Cube4で、管理画面とユーザ画面ともに、表題のエラーが発生した。キャッシュをクリアしようと思ったが、管理画面がこのような状態なので、にっちもさっちも行かなくなった。そこで、コマンドラインからキャッシュをクリアする。

>php bin/console cache:clear
Posted in EC Cube, php, 技術情報 | Leave a comment

\bin\console’ は、内部コマンドまたは外部コマンド、 操作可能なプログラムまたはバッチ ファイルとして認識されていません。

PHPコマンドとして、php から実行すること。

>php bin/console c:c
Posted in EC Cube, php, 技術情報 | Leave a comment

Docker で、denied: requested access to the resource is denied エラー

Dockerで、 ローカル環境からDockerhub へpush しようとしたが、 denied: requested access to the resource is denied エラーが出た。結論から言うと、下記のように Dockerhubの名前空間に変更しなければならないようだ。

denied: requested access to the resource is denied

>docker push hello
The push refers to repository [docker.io/library/hello]
75b7d7e2d2e1: Preparing                                                                                                 1a5ad2344ee1: Preparing                                                                                                 ace0eda3e3be: Preparing                                                                                                 denied: requested access to the resource is denied

docker image tag で名前空間のtag 名を付加する

>docker image tag hello:1.0 dockerhub_name/hello:1.0

再度、Dockerhubへpush。

>docker push dockerhub_name/hello:1.0
The push refers to repository [docker.io/dockerhub_name/hello]
75b7d7e2d2e1: Pushed                                                                                                    1a5ad2344ee1: Pushed                                                                                                    ace0eda3e3be: Pushed                                                                                                    1.0: digest: sha256:abcdefghijklmnopqrstuvwxyz123456789 size: 946
Posted in Docker, 技術情報 | Leave a comment