반응형

라이브 서버의 백업 데이터 파일을 테스트 서버로 이동후 테스트 서버를 구축 하고자함.

replicement로 5.5->10.2 로 업그레이드를 하는 작업중 mysql을 시작할때 mysqld에 다음과 같은 warning이 보인다

[Warning] 'proxies_priv' entry '@% root@master8-M' ignored in --skip-name-resolve mode.

 

select Host, User from mysql.proxies_priv;

Host User
localhost root
master8-M root

 

master8-M 이라는 것은 기존 서버의 호스트명이다.

이부분을 삭제해 주었더니 경고문이 사라졌다.

 

delete from mysql.proxies_priv where Host = 'master8-M';

 

반응형
반응형

mariaDB 10.2.44 에서 블랙홀 엔진을 default를 하고자 cnf 파일에 다음과 같이 넣어주었다.

default-storage-engine=BALCKHOLE

 

그러나 mysqld.err 에서 다음과 같은 에러를 만났다면

[ERROR] Unknown/unsupported storage engine: BLACKHOLE

 

cnf파일에 아래 내용을 추가해주자.

plugin_load_add = ha_blackhole

 

https://mariadb.com/kb/en/blackhole/

 

BLACKHOLE

Storage engine that accepts data without storing it.

mariadb.com

 

반응형

'MySQL' 카테고리의 다른 글

proxies_priv entry  (0) 2023.11.06
check table & repair table  (0) 2023.09.14
ERROR 1201  (0) 2023.09.01
[iptables] 2003, error connecting to master 'replicator@'  (0) 2023.08.24
컬럼명을 명령어 또는 공통변수(?)로 사용하게 된다면  (0) 2023.04.17
반응형

$ sudo gem install cocoapods

Building native extensions. This could take a while...
ERROR:  Error installing cocoapods:
ERROR: Failed to build gem native extension.


    current directory: /Library/Ruby/Gems/2.6.0/gems/ffi-1.16.3/ext/ffi_c
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20231018-31509-1t1qqqx.rb extconf.rb
checking for ffi.h... *** 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=/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/$(RUBY_BASE_NAME)
--with-ffi_c-dir
--without-ffi_c-dir
--with-ffi_c-include
--without-ffi_c-include=${ffi_c-dir}/include
--with-ffi_c-lib
--without-ffi_c-lib=${ffi_c-dir}/lib
--enable-debug
--disable-debug
--enable-system-libffi
--disable-system-libffi
--with-libffi-config
--without-libffi-config
--with-pkg-config
--without-pkg-config
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:467:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:585:in `block in try_compile'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:534:in `with_werror'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:585:in `try_compile'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:1109:in `block in have_header'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:959:in `block in checking_for'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:361:in `block (2 levels) in postpone'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:331:in `open'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:361:in `block in postpone'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:331:in `open'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:357:in `postpone'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:958:in `checking_for'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:1108:in `have_header'
from extconf.rb:10:in `system_libffi_usable?'
from extconf.rb:46:in `<main>'


To see why this extension failed to compile, please check the mkmf.log which can be found here:


  /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-22/2.6.0/ffi-1.16.3/mkmf.log


extconf failed, exit code 1


Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/ffi-1.16.3 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-22/2.6.0/ffi-1.16.3/gem_make.out

 

# 아래 링크 참조

https://gorails.com/setup/macos/10.11-el-capitan

 

Install Ruby On Rails on macOS 10.11 El Capitan | GoRails - GoRails

A guide to setting up a Ruby on Rails development environment on macOS 10.11 El Capitan with Git, MySQL, and PostgreSQL

gorails.com

1. brew 설치

$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

 

2. brew Path 지정

$ echo 'source ~/.bash_profile' >> ~/.zshrc

$ echo 'export PATH=/opt/homebrew/bin:$PATH' >> ~/.zshrc

$ source ~/.zshrc

 

3. ruby 설치

$ cd
$ git clone https://github.com/excid3/asdf.git ~/.asdf

$ vi ~/.zshrc

$HOME/.asdf/asdf.sh
$HOME/.asdf/completions/asdf.bash

$ echo 'legacy_version_file = yes' >> ~/.asdfrc
$ exec $SHELL

 

$ asdf plugin add ruby
$ asdf plugin add nodejs

 

$ brew install rbenv ruby-build

$ echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
$ source ~/.bash_profile

 

$ source ~/.zshrc

/Users/goodgods/.zshrc:5: permission denied: /Users/goodgods/.asdf/asdf.sh
/Users/goodgods/.zshrc:6: permission denied: /Users/goodgods/.asdf/completions/asdf.bash

$ chmod 755 /Users/goodgods/.asdf/asdf.sh

$ chmod 755 /Users/goodgods/.asdf/completions/asdf.bash

 

$ asdf install ruby 3.2.2

To follow progress, use 'tail -f /var/folders/4n/jmhh9dq501q3h4x0xbvhz8gc0000gn/T/ruby-build.20231018013346.97385.log' or pass --verbose
Downloading openssl-3.1.3.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/f0316a2ebd89e7f2352976445458689f80302093788c466692fb2a188b2eacf6
Installing openssl-3.1.3...
Installed openssl-3.1.3 to /Users/goodgods/.asdf/installs/ruby/3.2.2

Downloading ruby-3.2.2.tar.gz...
-> https://cache.ruby-lang.org/pub/ruby/3.2/ruby-3.2.2.tar.gz
Installing ruby-3.2.2...
ruby-build: using readline from homebrew
ruby-build: using libyaml from homebrew
Installed ruby-3.2.2 to /Users/goodgods/.asdf/installs/ruby/3.2.2

$ asdf global ruby 3.2.2

 

$ sudo gem update --system

Updating rubygems-update
Fetching rubygems-update-3.4.21.gem
Successfully installed rubygems-update-3.4.21
Parsing documentation for rubygems-update-3.4.21
Installing ri documentation for rubygems-update-3.4.21
Done installing documentation for rubygems-update after 0 seconds
Parsing documentation for rubygems-update-3.4.21
Done installing documentation for rubygems-update after 0 seconds
Installing RubyGems 3.4.21
  Successfully built RubyGem
  Name: bundler
  Version: 2.4.21
  File: bundler-2.4.21.gem
Bundler 2.4.21 installed
RubyGems 3.4.21 installed
Regenerating binstubs
Regenerating plugins
Parsing documentation for rubygems-3.4.21
Installing ri documentation for rubygems-3.4.21


# 3.4.21 / 2023-10-17


## Enhancements:


* Abort `setup.rb` if Ruby is too old. Pull request
  [#7011](https://github.com/rubygems/rubygems/pull/7011) by
  deivid-rodriguez
* Remove usage of Dir.chdir that only execute a subprocess. Pull request
  [#6930](https://github.com/rubygems/rubygems/pull/6930) by segiddins
* Freeze more strings in generated gemspecs. Pull request
  [#6974](https://github.com/rubygems/rubygems/pull/6974) by segiddins
* Use pure-ruby YAML parser for loading configuration at RubyGems. Pull
  request [#6615](https://github.com/rubygems/rubygems/pull/6615) by hsbt
* Installs bundler 2.4.21 as a default gem.


## Documentation:


* Update suggested variable for bindir. Pull request
  [#7028](https://github.com/rubygems/rubygems/pull/7028) by hsbt
* Fix invalid links in documentation. Pull request
  [#7008](https://github.com/rubygems/rubygems/pull/7008) by simi


# 3.4.20 / 2023-09-27


## Enhancements:


* Raise `Gem::Package::FormatError` when gem encounters corrupt EOF.
  Pull request [#6882](https://github.com/rubygems/rubygems/pull/6882)
  by martinemde
* Allow skipping empty license `gem build` warning by setting license to
  `nil`. Pull request
  [#6879](https://github.com/rubygems/rubygems/pull/6879) by jhong97
* Update SPDX license list as of 2023-06-18. Pull request
  [#6891](https://github.com/rubygems/rubygems/pull/6891) by
  github-actions[bot]
* Update SPDX license list as of 2023-04-28. Pull request
  [#6642](https://github.com/rubygems/rubygems/pull/6642) by segiddins
* Update SPDX license list as of 2023-01-26. Pull request
  [#6310](https://github.com/rubygems/rubygems/pull/6310) by segiddins
* Installs bundler 2.4.20 as a default gem.


## Bug fixes:


* Fixed false positive SymlinkError in symbolic link directory. Pull
  request [#6947](https://github.com/rubygems/rubygems/pull/6947) by
  negi0109
* Ensure that loading multiple gemspecs with legacy YAML class references
  does not warn. Pull request
  [#6889](https://github.com/rubygems/rubygems/pull/6889) by segiddins
* Fix NoMethodError when choosing a too big number from `gem uni` list.
  Pull request [#6901](https://github.com/rubygems/rubygems/pull/6901) by
  amatsuda


## Performance:


* Reduce allocations for stub specifications. Pull request
  [#6972](https://github.com/rubygems/rubygems/pull/6972) by segiddins


# 3.4.19 / 2023-08-17


## Enhancements:


* Installs bundler 2.4.19 as a default gem.


## Performance:


* Speedup building docs when updating rubygems. Pull request
  [#6864](https://github.com/rubygems/rubygems/pull/6864) by
  deivid-rodriguez


# 3.4.18 / 2023-08-02


## Enhancements:


* Add poller to fetch WebAuthn OTP. Pull request
  [#6774](https://github.com/rubygems/rubygems/pull/6774) by jenshenny
* Remove side effects when unmarshaling old `Gem::Specification`. Pull
  request [#6825](https://github.com/rubygems/rubygems/pull/6825) by nobu
* Ship rubygems executables in `exe` folder. Pull request
  [#6704](https://github.com/rubygems/rubygems/pull/6704) by hsbt
* Installs bundler 2.4.18 as a default gem.


# 3.4.17 / 2023-07-14


## Enhancements:


* Installs bundler 2.4.17 as a default gem.


## Performance:


* Avoid unnecessary work for private local gem installation. Pull request
  [#6810](https://github.com/rubygems/rubygems/pull/6810) by
  deivid-rodriguez


# 3.4.16 / 2023-07-10


## Enhancements:


* Installs bundler 2.4.16 as a default gem.


# 3.4.15 / 2023-06-29


## Enhancements:


* Installs bundler 2.4.15 as a default gem.


## Bug fixes:


* Autoload shellwords when it's needed. Pull request
  [#6734](https://github.com/rubygems/rubygems/pull/6734) by ioquatix


## Documentation:


* Update command to test local gem command changes. Pull request
  [#6761](https://github.com/rubygems/rubygems/pull/6761) by jenshenny


# 3.4.14 / 2023-06-12


## Enhancements:


* Load plugin immediately. Pull request
  [#6673](https://github.com/rubygems/rubygems/pull/6673) by kou
* Installs bundler 2.4.14 as a default gem.


## Documentation:


* Clarify what the `rubygems-update` gem is for, and link to source code
  and guides. Pull request
  [#6710](https://github.com/rubygems/rubygems/pull/6710) by davetron5000


# 3.4.13 / 2023-05-09


## Enhancements:


* Installs bundler 2.4.13 as a default gem.


# 3.4.12 / 2023-04-11


## Enhancements:


* [Experimental] Add WebAuthn Support to the CLI. Pull request
  [#6560](https://github.com/rubygems/rubygems/pull/6560) by jenshenny
* Installs bundler 2.4.12 as a default gem.


# 3.4.11 / 2023-04-10


## Enhancements:


* Installs bundler 2.4.11 as a default gem.




------------------------------------------------------------------------------


RubyGems installed the following executables:
/Users/goodgods/.asdf/installs/ruby/3.2.2/bin/gem
/Users/goodgods/.asdf/installs/ruby/3.2.2/bin/bundle
/Users/goodgods/.asdf/installs/ruby/3.2.2/bin/bundler


Ruby Interactive (ri) documentation was installed. ri is kind of like man 
pages for Ruby libraries. You may access it like this:
  ri Classname
  ri Classname.class_method
  ri Classname#instance_method
If you do not wish to install this documentation in the future, use the
--no-document flag, or set it as the default in your ~/.gemrc file. See
'gem help env' for details.


RubyGems system software updated

 

$ which ruby

/Users/goodgods/.asdf/shims/ruby

$ ruby -v

ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin22]

$ asdf install nodejs 18.16.1

Cloning node-build...
Downloading node-v18.16.1-darwin-arm64.tar.gz...
-> https://nodejs.org/dist/v18.16.1/node-v18.16.1-darwin-arm64.tar.gz
Installing node-v18.16.1-darwin-arm64...
Installed node-v18.16.1-darwin-arm64 to /Users/goodgods/.asdf/installs/nodejs/18.16.1

$ asdf global nodejs 18.16.1

$ which node

/Users/goodgods/.asdf/shims/node

$ node -v

v18.16.1

4. cocoapods 설치

$ sudo gem install cocoapods

Fetching atomos-0.1.3.gem
Fetching CFPropertyList-3.0.6.gem
Fetching colored2-3.1.2.gem
Fetching claide-1.1.0.gem
Fetching nanaimo-0.3.0.gem
Fetching xcodeproj-1.23.0.gem
Fetching ruby-macho-2.5.1.gem
Fetching nap-1.1.0.gem
Fetching molinillo-0.8.0.gem
Fetching gh_inspector-1.1.3.gem
Fetching fourflusher-2.3.1.gem
Fetching escape-0.0.4.gem
Fetching cocoapods-try-1.2.0.gem
Fetching netrc-0.11.0.gem
Fetching cocoapods-trunk-1.6.0.gem
Fetching cocoapods-search-1.0.1.gem
Fetching cocoapods-plugins-1.0.0.gem
Fetching cocoapods-downloader-1.6.3.gem
Fetching cocoapods-deintegrate-1.0.5.gem
Fetching ffi-1.16.3.gem
Fetching ethon-0.16.0.gem
Fetching typhoeus-1.4.0.gem
Fetching public_suffix-4.0.7.gem
Fetching fuzzy_match-2.0.4.gem
Fetching concurrent-ruby-1.2.2.gem
Fetching httpclient-2.8.3.gem
Fetching algoliasearch-1.27.5.gem
Fetching addressable-2.8.5.gem
Fetching tzinfo-2.0.6.gem
Fetching i18n-1.14.1.gem
Fetching connection_pool-2.4.1.gem
Fetching activesupport-7.1.1.gem
Fetching cocoapods-1.13.0.gem
Fetching cocoapods-core-1.13.0.gem
Successfully installed nanaimo-0.3.0
Successfully installed colored2-3.1.2
Successfully installed claide-1.1.0
Successfully installed CFPropertyList-3.0.6
Successfully installed atomos-0.1.3
/Users/goodgods/.asdf/lib/commands/reshim.bash: line 104: /Users/goodgods/.asdf/shims/update_rubygems: Permission denied
Successfully installed xcodeproj-1.23.0
Successfully installed ruby-macho-2.5.1
Successfully installed nap-1.1.0
Successfully installed molinillo-0.8.0
Successfully installed gh_inspector-1.1.3
Successfully installed fourflusher-2.3.1
Successfully installed escape-0.0.4
Successfully installed cocoapods-try-1.2.0
Successfully installed netrc-0.11.0
Successfully installed cocoapods-trunk-1.6.0
Successfully installed cocoapods-search-1.0.1
Successfully installed cocoapods-plugins-1.0.0
Successfully installed cocoapods-downloader-1.6.3
Successfully installed cocoapods-deintegrate-1.0.5
Building native extensions. This could take a while...
Successfully installed ffi-1.16.3
Successfully installed ethon-0.16.0
Successfully installed typhoeus-1.4.0
Successfully installed public_suffix-4.0.7
/Users/goodgods/.asdf/lib/commands/reshim.bash: line 104: /Users/goodgods/.asdf/shims/update_rubygems: Permission denied
Successfully installed fuzzy_match-2.0.4
Successfully installed concurrent-ruby-1.2.2
/Users/goodgods/.asdf/lib/commands/reshim.bash: line 104: /Users/goodgods/.asdf/shims/update_rubygems: Permission denied
Successfully installed httpclient-2.8.3
A new major version is available for Algolia! Please now use the https://rubygems.org/gems/algolia gem to get the latest features.
Successfully installed algoliasearch-1.27.5
Successfully installed addressable-2.8.5
Successfully installed tzinfo-2.0.6
Successfully installed i18n-1.14.1
Successfully installed connection_pool-2.4.1
Successfully installed activesupport-7.1.1
Successfully installed cocoapods-core-1.13.0
/Users/goodgods/.asdf/lib/commands/reshim.bash: line 104: /Users/goodgods/.asdf/shims/update_rubygems: Permission denied
/Users/goodgods/.asdf/lib/commands/reshim.bash: line 104: /Users/goodgods/.asdf/shims/update_rubygems: Permission denied
Successfully installed cocoapods-1.13.0
Parsing documentation for nanaimo-0.3.0
Installing ri documentation for nanaimo-0.3.0
Parsing documentation for colored2-3.1.2
Installing ri documentation for colored2-3.1.2
Parsing documentation for claide-1.1.0
Installing ri documentation for claide-1.1.0
Parsing documentation for CFPropertyList-3.0.6
Installing ri documentation for CFPropertyList-3.0.6
Parsing documentation for atomos-0.1.3
Installing ri documentation for atomos-0.1.3
Parsing documentation for xcodeproj-1.23.0
Installing ri documentation for xcodeproj-1.23.0
Parsing documentation for ruby-macho-2.5.1
Installing ri documentation for ruby-macho-2.5.1
Parsing documentation for nap-1.1.0
Installing ri documentation for nap-1.1.0
Parsing documentation for molinillo-0.8.0
Installing ri documentation for molinillo-0.8.0
Parsing documentation for gh_inspector-1.1.3
Installing ri documentation for gh_inspector-1.1.3
Parsing documentation for fourflusher-2.3.1
Installing ri documentation for fourflusher-2.3.1
Parsing documentation for escape-0.0.4
Installing ri documentation for escape-0.0.4
Parsing documentation for cocoapods-try-1.2.0
Installing ri documentation for cocoapods-try-1.2.0
Parsing documentation for netrc-0.11.0
Installing ri documentation for netrc-0.11.0
Parsing documentation for cocoapods-trunk-1.6.0
Installing ri documentation for cocoapods-trunk-1.6.0
Parsing documentation for cocoapods-search-1.0.1
Installing ri documentation for cocoapods-search-1.0.1
Parsing documentation for cocoapods-plugins-1.0.0
Installing ri documentation for cocoapods-plugins-1.0.0
Parsing documentation for cocoapods-downloader-1.6.3
Installing ri documentation for cocoapods-downloader-1.6.3
Parsing documentation for cocoapods-deintegrate-1.0.5
Installing ri documentation for cocoapods-deintegrate-1.0.5
Parsing documentation for ffi-1.16.3
Installing ri documentation for ffi-1.16.3
Parsing documentation for ethon-0.16.0
Installing ri documentation for ethon-0.16.0
Parsing documentation for typhoeus-1.4.0
Installing ri documentation for typhoeus-1.4.0
Parsing documentation for public_suffix-4.0.7
Installing ri documentation for public_suffix-4.0.7
Parsing documentation for fuzzy_match-2.0.4
Installing ri documentation for fuzzy_match-2.0.4
Parsing documentation for concurrent-ruby-1.2.2
Installing ri documentation for concurrent-ruby-1.2.2
Parsing documentation for httpclient-2.8.3
Installing ri documentation for httpclient-2.8.3
Parsing documentation for algoliasearch-1.27.5
Installing ri documentation for algoliasearch-1.27.5
Parsing documentation for addressable-2.8.5
Installing ri documentation for addressable-2.8.5
Parsing documentation for tzinfo-2.0.6
Installing ri documentation for tzinfo-2.0.6
Parsing documentation for i18n-1.14.1
Installing ri documentation for i18n-1.14.1
Parsing documentation for connection_pool-2.4.1
Installing ri documentation for connection_pool-2.4.1
Parsing documentation for activesupport-7.1.1
Couldn't find file to include 'activesupport/README.rdoc' from lib/active_support.rb
Installing ri documentation for activesupport-7.1.1
Parsing documentation for cocoapods-core-1.13.0
Installing ri documentation for cocoapods-core-1.13.0
Parsing documentation for cocoapods-1.13.0
Installing ri documentation for cocoapods-1.13.0
Done installing documentation for nanaimo, colored2, claide, CFPropertyList, atomos, xcodeproj, ruby-macho, nap, molinillo, gh_inspector, fourflusher, escape, cocoapods-try, netrc, cocoapods-trunk, cocoapods-search, cocoapods-plugins, cocoapods-downloader, cocoapods-deintegrate, ffi, ethon, typhoeus, public_suffix, fuzzy_match, concurrent-ruby, httpclient, algoliasearch, addressable, tzinfo, i18n, connection_pool, activesupport, cocoapods-core, cocoapods after 7 seconds
34 gems installed

5. 버전 확인

$ pod -v

/Users/goodgods/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/activesupport-7.1.1/lib/active_support/core_ext/array/conversions.rb:108:in `<class:Array>': undefined method `deprecator' for ActiveSupport:Module (NoMethodError)

  deprecate to_default_s: :to_s, deprecator: ActiveSupport.deprecator
                                                          ^^^^^^^^^^^
Did you mean?  deprecate_constant
from /Users/goodgods/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/activesupport-7.1.1/lib/active_support/core_ext/array/conversions.rb:8:in `<top (required)>'
from <internal:/Users/goodgods/.asdf/installs/ruby/3.2.2/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:86:in `require'
from <internal:/Users/goodgods/.asdf/installs/ruby/3.2.2/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:86:in `require'
from /Users/goodgods/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/cocoapods-1.13.0/lib/cocoapods.rb:9:in `<top (required)>'
from <internal:/Users/goodgods/.asdf/installs/ruby/3.2.2/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:86:in `require'
from <internal:/Users/goodgods/.asdf/installs/ruby/3.2.2/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:86:in `require'
from /Users/goodgods/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/cocoapods-1.13.0/bin/pod:36:in `<top (required)>'
from /Users/goodgods/.asdf/installs/ruby/3.2.2/bin/pod:25:in `load'
from /Users/goodgods/.asdf/installs/ruby/3.2.2/bin/pod:25:in `<main>'
'

$ sudo gem uninstall activesupport

You have requested to uninstall the gem:
activesupport-7.1.1

cocoapods-core-1.13.0 depends on activesupport (>= 5.0, < 8)
If you remove this gem, these dependencies will not be met.
Continue with Uninstall? [yN]  y
Successfully uninstalled activesupport-7.1.1

$ sudo gem install activesupport -v 7.0.8

Fetching activesupport-7.0.8.gem
Successfully installed activesupport-7.0.8
Parsing documentation for activesupport-7.0.8
Installing ri documentation for activesupport-7.0.8
Done installing documentation for activesupport after 0 seconds
1 gem installed

$ pod --version

1.13.0

$ pod -v

[!] Unknown command: `-v`
Did you mean: env?

Usage:

    $ pod COMMAND

      CocoaPods, the Cocoa library package manager.

Commands:

    + cache         Manipulate the CocoaPods cache
    + deintegrate   Deintegrate CocoaPods from your project
    + env           Display pod environment
    + init          Generate a Podfile for the current directory
    + install       Install project dependencies according to versions from a
                    Podfile.lock
    + ipc           Inter-process communication
    + lib           Develop pods
    + list          List pods
    + outdated      Show outdated project dependencies
    + plugins       Show available CocoaPods plugins
    + repo          Manage spec-repositories
    + search        Search for pods
    + setup         Set up the CocoaPods environment
    + spec          Manage pod specs
    + trunk         Interact with the CocoaPods API (e.g. publishing new specs)
    + try           Try a Pod!
    + update        Update outdated project dependencies and create new Podfile.lock

Options:

    --allow-root    Allows CocoaPods to run as root
    --silent        Show nothing
    --version       Show the version of the tool
    --verbose       Show more debugging information
    --no-ansi       Show output without ANSI codes
    --help          Show help banner of specified command

 

반응형
반응형

# lzop 설치

$ yum install lzop

 

# 압축 풀기

$ tar --use-compress-program=lzop -xf sample.tar.lzo

반응형

'Unix & Linux' 카테고리의 다른 글

yum 에서 설치가 되지 않을때(appstream)  (0) 2022.06.20
[HP-UX] vi 자동들여쓰기(?) 문제  (0) 2022.06.17
리눅스 폴더,파일,vi 컬러 설정  (0) 2022.06.08
사용자 계정 삭제  (0) 2022.03.18
terminal too wide  (0) 2022.01.07
반응형

mysql> check table mysql.proxies_priv;
+--------------------+-------+----------+-------------------------------------------------------------------------------------------+
| Table              | Op    | Msg_type | Msg_text                                                                                  |
+--------------------+-------+----------+-------------------------------------------------------------------------------------------+
| mysql.proxies_priv | check | error    | Table upgrade required. Please do "REPAIR TABLE `proxies_priv`" or dump/reload to fix it! |
+--------------------+-------+----------+-------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> repair table mysql.proxies_priv;
+--------------------+--------+----------+-------------------------------------------------------------------------------------+
| Table              | Op     | Msg_type | Msg_text                                                                            |
+--------------------+--------+----------+-------------------------------------------------------------------------------------+
| mysql.proxies_priv | repair | Note     | TIME/TIMESTAMP/DATETIME columns of old format have been upgraded to the new format. |
| mysql.proxies_priv | repair | status   | OK                                                                                  |
+--------------------+--------+----------+-------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)

mysql> check table mysql.proxies_priv;
+--------------------+-------+----------+----------+
| Table              | Op    | Msg_type | Msg_text |
+--------------------+-------+----------+----------+
| mysql.proxies_priv | check | status   | OK       |
+--------------------+-------+----------+----------+
1 row in set (0.00 sec)

반응형
반응형
반응형
반응형

현재 mongod 버전이 os centos7 의 mongodb-rhel70-4.2.15 이다. openssl 1.0.1

신규서버에 mongos를 추가적으로 설치를 진행하였다. 이 과정에서 os 호환되는 문제로 발생된 히스토리를 적어보고자 한다.

 

(1) ole9 , mongodb-rhel70-4.2.15 

openssl이 3점대버전으로 에러가 발생 되었고, 이것을 맞춰주고자 openssl 1.0.1을 설치하였다. 설치하는 방법은 추후에 작성하도록 하겠다.

이후 실행은 되었으나, 실행할때 "/lib64/libcrypto.so.10: no version information available" 문구를 계속 보여주고 있다.

디비에 접속하여 select 하는 것에 대해서는 문제가 되지 않았다.

 

(2) ole9 , mongodb-rhel90-6.0.9

openssl은 기존 버전대로 1.0.1을 계속 사용한다.

"code dumped"라는 에러 메세지를 보여주면서 실행이 되지 않는다.

 

(3) ole8, mongodb-rhel80-4.4.24

“remote host has incompatible wire version: Server min and max wire version...." 처럼 mongod와 호환성이 맞지 않는다는 에러를 보여주고 있다.

 

(4) ole8, mongodb-rhel80-4.2.24

정상적으로 설치가 되었다.

 

 - 참고로 mongodb-4.4 이후 버전부터 ./bin 파일을 보면 mongodump라던지 누락된 파일들이 많이 있다.

이것은 database tool 및 mongo shell 다운받아서 설치를 해줘야한다.

 

아래 다운로드 경로 및 documentation 를 참고하자

https://mongodb.com/try/download/shell

https://mongodb.com/try/download/database-tools

https://mongodb.com/docs/database-tools/

반응형

'BigData > mongoDB' 카테고리의 다른 글

mongos 정상종료  (0) 2023.08.30
반응형

mysql 5.5 를 사용하고 있는 DB에서

replication 연결된 slave(replica) 서버를 5.6 으로 올렸다.

 

다시 5.5를 실행시켜서 슬레이브로 연결하려면 연결이 되는지 의문이 생겨서 시도를 해보았다.

결과는 에러가 발생하였다.

mysql> start slave;
ERROR 1201 (HY000): Could not initialize master info structure; more error messages can be found in the MySQL error log

 

반응형
반응형

$ ps -ef | grep mongo

root    50273          1    0    Aug29 ?     00:02:00     /mongo/bin/mongos -f /mongo/conf/mongos_44001.conf

 

프로세스를 kill시키지 않고 정상적으로 종료하는 방법

/mongo/bin/mongo localhost:32001/admin -quiet -u 'root' -p

mongos> use admin -> 이미 admin으로 접속했으나 만약 그렇지 않았을 경우 admin으로 접속후 실행하자.

mongos> db.shutdownServer();

> exit;

$ ps -ef | grep mongo : 프로세스가 없는 것을 볼 수있다.

 

반응형

'BigData > mongoDB' 카테고리의 다른 글

mongos 설치 호환성에 대한 요약  (0) 2023.09.07
반응형

replication연결 중 아래와 같은 에러가 발생하였다.
해당에러는 패스워드가 다르다거나 연결에 있어서 다양한 문제가 생겼을 경우 나오는 에러이다.

Last_IO_Errno: 2003
Last_IO_Error: error connecting to master 'replicator@100.10.12.15:3306' - retry-time: 10  retries: 86400


그중 하나가 소스(마스터)에서 3306 포트를 열어주지 않아서 생겼던 문제로 보인다.

telnet ip 3306

연결이 되지 않는다고 나온다면 소스(마스터)의 방화벽에서 해당 포트를 열어주자.

방화벽 포트 추가

iptables -I INPUT -p tcp --dport 3306 -j ACCEPT





반응형

'MySQL' 카테고리의 다른 글

check table & repair table  (0) 2023.09.14
ERROR 1201  (0) 2023.09.01
컬럼명을 명령어 또는 공통변수(?)로 사용하게 된다면  (0) 2023.04.17
스토리지 엔진  (0) 2022.10.21
my.cnf  (0) 2022.09.28
반응형

2. schema 컬럼, 명령어 또는 공통 변수(?) 로 사용되는 이름이 컬럼으로 쓰일때

mysql> create table tb_test1(`schema` varchar(30));

Query OK, 0 rows affected (0.02 sec)

 

mysql> desc tb_test1;

+--------+-------------+------+-----+---------+-------+

| Field  | Type        | Null | Key | Default | Extra |

+--------+-------------+------+-----+---------+-------+

| schema | varchar(30) | YES  |     | NULL    |       |

+--------+-------------+------+-----+---------+-------+

1 row in set (0.01 sec)

 

mysql> select * from tb_test1 where schema = '11';

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 '= '11'' at line 1

mysql> select * from tb_test1 where `schema` = '11';

Empty set (0.00 sec)

 

schema 는 mysql에서 공통으로 사용되고 있기때문에 에러가 발생되는 것 같다.

그래서 "``" 를 붙여주니 잘 작동하였음.

반응형

'MySQL' 카테고리의 다른 글

ERROR 1201  (0) 2023.09.01
[iptables] 2003, error connecting to master 'replicator@'  (0) 2023.08.24
스토리지 엔진  (0) 2022.10.21
my.cnf  (0) 2022.09.28
1406, Data too long for column 과 STRICT_TRANS_TABLES  (0) 2022.09.28
반응형

innodb : 일반적인 엔진이며, insert등 dml 을 하는데 유리하다. 작업시 로우 단위로 락이 걸린다.

myISAM : select 가 위주일 때 많이 쓰인다. 만약 dml작업을 한다면 테이블 락이 걸린다.

memory : ????

반응형
반응형

$ php -i

반응형

'Programming > PHP' 카테고리의 다른 글

date 계산  (0) 2016.05.26
Fatal error: Maximum execution time of 30 seconds exceeded  (0) 2015.10.22
error 메세지 출력  (0) 2015.10.22
bitnami  (0) 2015.10.21
phpexcel 설치  (0) 2015.10.13
반응형

오라클의 pfile과 같다고 생각하였다.

 

1. my.cnf 파일 없다면 데이터 베이스는 올라올까?

테스트 결과 my.cnf가 없어도 디비는 올라왔다.

오라클에서는 pfile 또는 spfile이 반드시 존재해야하는 반면에 mysql에는 my.cnf이 없어도 작동 되는 것을 확인하였다.

다만 my.cnf에서 설정된 시스템 변경 값이 디폴트로 바뀌는 것도 함께 확인을 하였다.

그런데 테스트로는 올라온것을 확인하였으나, 무조건 my.cnf 파일이 있어야 된다는 의견도 있어서 다소 헷갈리는 부분이다.

 

2. my.cnf 파일은 어디에 존재하는가?

my.cnf가 찾을수 없을 때 아래 명령어로 파일을 찾아 나갈수 있다.

find / -name 'my.cnf' 로 파일의 위치를 찾을수가 있다.

 

다만 여기서 실제 적용되고 있는 파일인지 그게 좀 헷갈린다. 파일 내용을 변경하고 적용해보지 않는 이상은 모르는게 아닌가?

데이터베이스 안에서 찾을 수 있는 방법이 있지 않을까 했지만, 없는 것 같다.

 

그래서 최선의 방법으로 아래 명령어로 따라가서 찾아봐야할 것 같다.

$ mysql --help | grep -A 1 'Default options'

결과값을 보면 여러 경로가 나오는데 이것은 우선순위로 my.cnf 를 참조한다고 한다.

Default options are read from the following files in the given order:

/etc/my.cnf /etc/mysql/my.cnf /usr/local/etc/my.cnf ~/.my.cnf 

필자의 my.cnf 경로는 /usr/local/etc/my.cnf 에 존재하였다.

 

3. my.cnf 경로를 변경해 줄 수는 없는 것인가?

그리고 궁금한 것 중 또 하나는 my.cnf 값을 우선순위 경로로 읽고 있다면, 이 우선순위 경로외에 다른 경로에서 불러 올 수 있는 방법은 있지 않을까 라는 의문이 생겼다.

이것은 아래와 같이 설정에서 바꿔줄 수 있다고 한다. 

우선 우리가 mysql을 실행시킬때 사용하는 mysql.server 을 vi 열어 보면 된다.

$ which mysql.server
/usr/local/bin/mysql.server

 

$ vi /usr/local/bin/mysql.server

$bindir/mysqld_safe --datadir="$datadir" --pid-file="$mysqld_pid_file_path" $other_args >/dev/null &
$bindir/mysqld_safe --defaults-extra-file=/usr/local/etc/my.cnf --datadir="$datadir" --pid-file="$mysqld_pid_file_path" $other_args >/dev/null &

mysqld_safe 바로 뒤에 위치에 해야한다

이렇게 설정하면 저 파일외에 다른 쪽 my.cnf 파일은 읽어 올수가 없다고 한다. 라고 알고있었지만,

default경로에 my.cnf 파일이 있다면 이 파일부터 읽게 된다.

반응형
반응형

 

set @@global.sql_mode = "ONLY_FULL_GROUP_BY,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION";

 

set @@global.sql_mode = 

"ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"

 

 

python에서 mariadb에 인서트를 하는중에 아래와 같은 에러가 출력되었다.

pymysql.err.DataError: (1406, "Data too long for column 'name' at row 1")

 

넣을려는 값이 더 커서 그런가보다 했지만, 다른 쪽에서는 길었음에도 불구하고 데이터가 잘려서 인서트 되는 경우를 보게 되었다.

이상하게 생각되어 찾아보던 중 이런 설정이 있었다.

 

select @@global.sql_mode;
+--------------------------------------------------------------------------------------------------------------------+
| @@global.sql_mode                                                                                                     |
+--------------------------------------------------------------------------------------------------------------------+
| ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION |
+--------------------------------------------------------------------------------------------------------------------+

 

strict_trans_tables 의 값이 있다면 데이터가 안들어가고 에러를 내뱉고, 없다면 자동으로 알아서 데이터를 잘라서 넣어주는 것이였다.

이것을 설정을 바꾼다면 insert가 가능하다.

set @@global.sql_mode = "ONLY_FULL_GROUP_BY,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION";

설정이 되었다고 바로 적용되는 것은 아니고 해당세션을 새로 접속하면 적용된 것을 볼 수 있다.

 

 

아래는 테스트한 결과 입니다.

mysql> use prod

Database changed

mysql> create table strict_table_test 
    -> (name varchar(10))
    -> ;
Query OK, 0 rows affected (0.01 sec)

-- 10자리 입력
mysql> insert into strict_table_test values('1111111111');
Query OK, 1 row affected (0.01 sec)

-- 11자리 입력
mysql> insert into strict_table_test values('11111111145');
ERROR 1406 (22001): Data too long for column 'name' at row 1

mysql> select @@global.sql_mode;
+-----------------------------------------------------------------------------------------------------------------------+
| @@global.sql_mode                                                                                                     |
+-----------------------------------------------------------------------------------------------------------------------+
| ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION |
+-----------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> set @@global.sql_mode = 
    -> "ONLY_FULL_GROUP_BY,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION";
Query OK, 0 rows affected (0.00 sec)

mysql> exit
Bye
user@macos mysql % mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 8.0.22 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> use prod
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

-- 11자리 입력
mysql> insert into strict_table_test values('11111111145');
Query OK, 1 row affected, 1 warning (0.01 sec)

mysql> select * from strict_table_test;
+------------+
| name       |
+------------+
| 1111111111 |
| 1111111114 |  => 마지막 1자리를 제외하고 인서트 된 것을 확인할 수 있다.
+------------+
2 rows in set (0.00 sec)

 

반응형

'MySQL' 카테고리의 다른 글

스토리지 엔진  (0) 2022.10.21
my.cnf  (0) 2022.09.28
transaction이 완벽하지 않은듯하다?  (0) 2022.09.28
시스템 환경설정 확인 방법의 차이?  (0) 2022.09.28
파일에 쓰기  (0) 2022.07.28
반응형

내가 트랙잭션을 걸고 작업을 한다면 문제가 없을것같지만, 다른 세션에서 dml 작업이 들어간다면 혼선이 올수 있을 것 같다.

다른 세션이 dml이 하였을 때 트랜잭션을 건 내 세션에서는 반영이 되는 경우가 있고 안되는 경우가 있는데 왜 그런지 알수가 없었다.

 

start transaction을 하였을 경우 rollback이나 commit이 오기전 까지는 transaction이 계속 활성화 상태로 되어있다고 생각하였다.

그러나 여기서 이상한점은 다른 세션에서 insert를 하였을 경우 transaction 을 건 세션은 select문을 초기 실행 했느냐안했느냐에 따라서 반영이되고안되고를 오락가락 하는것같은데 관련 정리가 필요해 보인다고 생각하였다.

 

이런 의문을 품던중 아래 링크 설명을 보았다. 해당 글을 자세하게 읽어보면 이해를 할 수 있다.

https://zzang9ha.tistory.com/381

 

[MySQL] - 트랜잭션의 격리 수준(Isolation level)

📎 글또 6기 포스팅 1. 미치도록 더웠던 7월의 회고 2. 사용자가 게시물을 작성할 때의 트랜잭션 처리 3. Spring AOP - (1) 프록시 패턴, 데코레이터 패턴 4. [MySQL] - 트랜잭션의 격리 수준(Isolati

zzang9ha.tistory.com

 

show variables like '%isolation%'; 의 격리 수준에 따라 transaction 의 조회하는 상황이 바뀌는 것이였다.

이것은 트랜잭션을 상황에 따라서 변경을 할 수 있다고 하지만, 어떤 케이스에 사용을 해야할지는 의문이다.

 

# tx_isolation 또는 transaction_isolation

tx_isolation으로 사용되오다가 5.7.20부터 transaction_isolation 이  alias 로 추가가 되었다.

그리고 8.0부터는 tx_isolation이 사라졌다.

 

5.7.37 에 2개가 동시에 존재하는 이유는 이때까지는 alias로 사용되어져 왔기때문이라 생각된다.

설정값에는

1. read-uncommitted

2. read-committed

3. repeatable-read

4. serializable

 

1. read-uncommitted

dml 작업이 이루어졌다면 다른 세션에서는  타세션에서 작업한 내용들이 commit 유무를 떠나서 그대로 반영되어 보여진다.

트랜잭션에서 처리가 완료되지 않았음에도 불구하고 다른세션에서 보였다 안보였다 할수있는 것을 더티리드라고 한다.

이런 더티리드가 사용자에게서 혼란을 줄수있기때문에 비권장하는 설정값이다.

 

2. read-committed

dml 작업이 이루어지고, commit을 하였다면 다른 세션에서는 commit된 데이터만 반영되어져서 보여진다.

이것은 오라클에서 적용하는 방법과 가장 유사하다고 생각한다. 보통 이것으로 설정하는 것을 기본으로 한다.

그러나 mysql에서는 이런 방식도 문제가 될수잇다고 한다. 왜냐하면 초반에 select를 하였을때 보여지지 않았던 데이터가 나중에 보여질수 있는 문제가 있다는 것이다. 이것은 입출금 처리가계속 진행중에 다른쪽에서 조회를 한다면 문제가 될수있다고 한다. 조회결과가 들쑥날쑥 변화할수 있다는 것이다.

 

3. repeatable-read

dml 작업이 이루어지고 commit도 이루워졌지만, 다른 세션에서 dml 작업이 이루어지기전에 transaction을 걸었다면 계속 변경되지 않은 값으로 보여진다.

이것은 언두에서 계속 저장해뒀다가 보여주게 되는 것인데, 만약 세션이 닫히지 않았다면 언두는 계속 쌓여져서 불필요한데이터가 남아 있을 수가 있다. mysql을 설치하면 default 값이다.

 

4. serializable

start transaction이 이루어진 세션이 있다면 다른 세션에서는 접근을 할 수가 없다.읽기작업도 할수가 없다.

반응형

'MySQL' 카테고리의 다른 글

my.cnf  (0) 2022.09.28
1406, Data too long for column 과 STRICT_TRANS_TABLES  (0) 2022.09.28
시스템 환경설정 확인 방법의 차이?  (0) 2022.09.28
파일에 쓰기  (0) 2022.07.28
root 패스워드 변경  (0) 2017.08.21
반응형

show variables like '%datadir%' 와 select @@datadir 의 차이가 뭔가 싶었다.

똑같은 값을 내뱉는데 왜 이렇게 다르게 명령어를 줄까 싶었는데

눈으로 봤을때 차이점은 select @@datadir 로 하였을때는 해당 변수값만 보여주고 variable은 보여지지 않는다는 것이다.

 

mysql> show variables like 'datadir';

+---------------+-----------------------+

| Variable_name | Value                 |

+---------------+-----------------------+

| datadir       | /usr/local/var/mysql/ |

+---------------+-----------------------+

1 row in set (0.00 sec)

 

mysql> select @@datadir;

+-----------------------+

| @@datadir             |

+-----------------------+

| /usr/local/var/mysql/ |

+-----------------------+

1 row in set (0.00 sec)

 

그리고 또하나는 select 했을 경우 like처리가 안된다는 것이다.

mysql> select @@transaction_isolation;

+-------------------------+

| @@transaction_isolation |

+-------------------------+

| REPEATABLE-READ         |

+-------------------------+

1 row in set (0.00 sec)

 

mysql> show variables like '%isolation%';

+-----------------------+-----------------+

| Variable_name         | Value           |

+-----------------------+-----------------+

| transaction_isolation | REPEATABLE-READ |

+-----------------------+-----------------+

1 row in set (0.01 sec)

반응형

'MySQL' 카테고리의 다른 글

my.cnf  (0) 2022.09.28
1406, Data too long for column 과 STRICT_TRANS_TABLES  (0) 2022.09.28
transaction이 완벽하지 않은듯하다?  (0) 2022.09.28
파일에 쓰기  (0) 2022.07.28
root 패스워드 변경  (0) 2017.08.21
반응형

 

for i in range(0,20):
    globals()['value_{}'.format(i)] = i

print(value_1)
print(value_19)

 

참고로 동적변수를 print 하였을 때 계속 null값이 나와서 당황하였으나, 이후 알고 보니 변수 선언을 해줘서 발생했던 문제이다.

아래는 잘못된 표현이다.

value_1 = value_2 = ....... value_19 = '' => 잘못된 선언
for i in range(0,20):
    globals()['value_{}'.format(i)] = i

print(value_1)
print(value_19)

 

위 잘못된 선언을 하고자 한다면

globals() 대신 locals()를 사용하면된다.

value_1 = value_2 = ....... value_19 = ''
for i in range(0,20):
    locals()['value_{}'.format(i)] = i

print(value_1)

print(value_19)
반응형

'Programming > python' 카테고리의 다른 글

bz2  (0) 2022.07.20
반응형

#!/bin/sh

today=`date +%Y%m%d`

before=~date +%Y%m%d -d "-1 year"`

connect='/mysql/local/mysql/bin/mysql -uroot -p123456 DBNAME -S /tmp/mysql.sock -N '

$connect -e "select * from dept where reg_date > ${before} " > /data/dept_${today}.txt

 

반응형

'MySQL' 카테고리의 다른 글

my.cnf  (0) 2022.09.28
1406, Data too long for column 과 STRICT_TRANS_TABLES  (0) 2022.09.28
transaction이 완벽하지 않은듯하다?  (0) 2022.09.28
시스템 환경설정 확인 방법의 차이?  (0) 2022.09.28
root 패스워드 변경  (0) 2017.08.21
반응형

>> import bz2
>> str = b"sqlplus scott/tiger"

 

# compress

>> compress_str = bz2.compress(str)

>> print(compress_str)

b'BZh91AY&SYY\xf9\xdb\xc5\x00\x00\x07\x11\x80@\x00\x8a\xa4\xfe\x00 \x001\x00\x00\x08@d\xf0\xa1X\xedh\x9b\x14\x18~N\xfe.\xe4\x8ap\xa1 \xb3\xf3\xb7\x8a'

 

# decompress

>> decompress_str = bz2.decompress(compress_str)

>> print(d)

b"sqlplus scott/tiger"

 

>> print(d.decode())
sqlplus scott/tiger

 

 

# 오라클 접속 예시

>> import os

>> os.system(bz2.decompress(compress_str))

 

https://docs.python.org/3/library/bz2.html

 

bz2 — Support for bzip2 compression — Python 3.10.5 documentation

bz2 — Support for bzip2 compression Source code: Lib/bz2.py This module provides a comprehensive interface for compressing and decompressing data using the bzip2 compression algorithm. The bz2 module contains: (De)compression of files bz2.open(filename,

docs.python.org

 

반응형

'Programming > python' 카테고리의 다른 글

동적변수  (0) 2022.07.28
반응형

1. UTL_HTTP 사용하는 프로시저를 컴파일을 하였지만 다음과 같은 에러가 발생하였다.

ORA-06550: line 3, column 6:
PLS-00201: identifier 'SYS.UTL_HTTP' must be declared
ORA-06550: line 3, column 6:

 

2. 원인을 찾던 중 utl_http 가 정의(?)가 되지 않았음을 알 수 있었다. 알 수 있었던 방법은 단순하였다.

https://community.oracle.com/tech/developers/discussion/469405/problem-calling-utl-http-in-oracle-xe

$ sqlplus "/as sysdba"

SQL> desc utl_http

utl_http의 정보들이 출력이 될 것이다.

SQL> conn system/123456

SQL> desc utl_http

ERROR:
ORA-04043: object "SYS"."UTL_HTTP" does not exist

SQL> select * from dba_tab_privs where table_name = 'UTL_HTTP';

GRANTEE OWNER TABLE_NAME GRANTOR PRIVILEGE GRANTABLE HIERARCHY
SCOTT SYS UTL_HTTP SYS EXECUTE NO NO

 

3. object 권한을 주면 해결이 된다.

https://stackoverflow.com/questions/27379194/grant-utl-http-permission-in-plsql

$ sqlplus "/as sysdba"

SQL> grant execute on UTL_HTTP to system;

SQL> conn system/123456

SQL> desc UTL_HTTP

 

SQL> select * from dba_tab_privs where table_name = 'UTL_HTTP';

GRANTEE OWNER TABLE_NAME GRANTOR PRIVILEGE GRANTABLE HIERARCHY
SCOTT SYS UTL_HTTP SYS EXECUTE NO NO
SYSTEM SYS UTL_HTTP SYS EXECUTE NO NO

 

4. 컴파일할 때 발생되었던 에러는 사라졌으나, 막상 프로시저를 실행시켰더니 다음과 같은 에러가 발생하였다.

ERROR at line 1:
ORA-29273: HTTP request failed
ORA-06512: at "SYS.UTL_HTTP", line 1577
ORA-24247: network access denied by access control list (ACL)
ORA-06512: at line 1

 

5. 여기에도 ACL권한을 부여해야 한다는 것이다. 등록되어있지 않다면 등록을 해줘야한다.

SQL> select * from dba_network_acl_privileges;

ACL ACLID PRINCIPAL PRIVILEGE IS_GRANT INVERT START_DATE END_DATE

SQL> select * from dba_network_acls;

HOST LOWER_PORT UPPER_PORT ACL ACLID

등록(생성)은 이렇게 하자

begin
    dbms_network_acl_admin.create_acl(
        acl=>'test.xml',
        description=>'test', -> description 빼도 될것같아서 기입을 안했더니 에러 발생
        principal=>'SYSTEM',
        is_grant=>true,
        privilege=>'connect',
        start_date=>'sysdate);

    dbms_network_acl_admin.add_privilege(

        acl=>'test.xml',
        description=>'test',
        principal=>'SYSTEM',
        is_grant=>true,
        privilege=>'resolve');

    dbms_network_acl_admin.assign_acl(
        acl=>'test.xml',
        host=>'api.goodgods.com');

    commit;
end;
/

삭제가 필요하다면

begin
    dbms_network_acl_admin.drop_acl(
        acl=>'test.xml');
end;
/

SQL> select * from dba_network_acl_privileges;

ACL ACLID PRINCIPAL PRIVILEGE IS_GRANT INVERT START_DATE END_DATE
/sys/acls/test.xml EFFEFASDf234DFADf SYSTEM connect true false 2022/06/21  
/sys/acls/test.xml EFFEFASDf234DFADf SYSTEM resolve true false 2022/06/21  

SQL> select * from dba_network_acls;

HOST LOWER_PORT UPPER_PORT ACL ACLID
api.goodgods.com     /sys/acls/test.xml EFFEFASDf234DFADf

* 참고로 12c 부터 아래 object로 변경되었다.

dba_network_acl_privileges => DBA_HOST_ACES

dba_network_acls => DBA_HOST_ACLS

 

6. 프로시저가 제대로 작동하는 것을 알 수 있을 것이다.

이것은 11g부터 적용된 사항이라 하며, 10g 이하 버전은 해당사항이 없다고 한다.

다만 UTL_HTTP 권한 정도는 확인을 하자.(본 글 "3. object 권한을 주면 해결이 된다." 참고)

 

 

7. 참고 URL(더 상세하게 나와있으니 참고하자)

https://m.blog.naver.com/PostView.naver?isHttpsRedirect=true&blogId=nkyle9361&logNo=220676267478

 

UTL_HTTP를 이용한 HTTP 통신

UTL_HTTP를 이용한 HTTP 통신 출처 : ransu.tistory.com/26 1. GET 방식 SELECT UT...

blog.naver.com

https://blog.naver.com/PostView.naver?blogId=nkyle9361&logNo=221989499061&parentCategoryNo=&categoryNo=1&viewDate=&isShowPopularPosts=false&from=postView 

 

utl_http 를 사용하기 위한 ACL 권한설정

오라클 HTTP 통신을 하기 위한 ACL 목록등록 1. ACL 생성 ( DBA 계정으로 ) DECLARE ...

blog.naver.com

 

반응형
반응형

$ yum install vim -y

yum에서 vim을 설치하고자 하였으나 다음과 같은 에러가 발생하였다.

CentOS Linux 8 - AppStream                                                                             60  B/s |  38  B     00:00    
Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist

 

repo쪽의 경로가 잘못 인식되어서 발생되는 경우이다. 아래와 같이 URL을 변경하여 해결 할 수 있다.

$ sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-*
$ sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-Linux-*

$ yum install vim -y

 

참고로 yum을 설치할때 다운받는 경로는 /etc/yum.repos.d/CentOS-Linux-* 파일들에서 찾아볼수 있다.

반응형

'Unix & Linux' 카테고리의 다른 글

tar.lzo  (0) 2023.09.25
[HP-UX] vi 자동들여쓰기(?) 문제  (0) 2022.06.17
리눅스 폴더,파일,vi 컬러 설정  (0) 2022.06.08
사용자 계정 삭제  (0) 2022.03.18
terminal too wide  (0) 2022.01.07
반응형

1. 리눅스 설치(CentOS)

$ docker search centos

$ docker pull centos

$ docker run -it --name hadoop centos /bin/bash

 

2. wget, vim 설치

[hadoop] yum install wget -y && yum install vim -y

 

아래와 동일한 에러가 발생할 경우 클릭

Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist

 

3. Java 설치

$ yum install java-1.8.0-openjdk-devel.x86_64 -y

$ java -version

openjdk version "1.8.0_312"

OpenJDK Runtime Environment (build 1.8.0_312-b07)

OpenJDK 64-Bit Server VM (build 25.312-b07, mixed mode)

 

4. java 환경변수 설정

$ which java

/usr/bin/java

$ readlink -f $(which java)

/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.312.b07-2.el8_5.x86_64/jre/bin/java

$ vi ~/.bashrc

# java
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.312.b07-2.el8_5.x86_64
export PATH=$PATH:$JAVA_HOME/bin
export JAVA_OPTS="-Dfile.encoding=UTF8"
export CLASSPATH="."

5. Hadoop 설치 (독립 실행 모드)

1) 폴더 만들기

$ mkdir /hadoop_home
$ cd /hadoop_home

 

2) 다운로드
$ wget https://mirrors.sonic.net/apache/hadoop/common/hadoop-3.3.1/hadoop-3.3.1.tar.gz

 

3) 압축 풀기

$ tar xvzf hadoop-3.3.1.tar.gz

 

4) 환경변수 설정

$ vi ~/.bashrc

# hadoop
export HADOOP_HOME=/hadoop_home/hadoop-3.3.1
export HADOOP_CONFIG_HOME=$HADOOP_HOME/etc/hadoop
export PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin

5) 설치 확인

$ hadoop version

Hadoop 3.3.1
Source code repository https://github.com/apache/hadoop.git -r a3b9c37a397ad4188041dd80621bdeefc46885f2
Compiled by ubuntu on 2021-06-15T05:13Z
Compiled with protoc 3.7.1
From source with checksum 88a4ddb2299aca054416d6b7f81ca55
This command was run using /hadoop_home/hadoop-3.3.1/share/hadoop/common/hadoop-common-3.3.1.jar

6. Mapreduce 사용

$ hadoop jar $HADOOP_HOME/share/hadoop/mapreduce/hadoop-mapreduce-examples-3.3.1.jar wordcount $HADOOP_HOME/LICENSE.txt wordcount_output

-> hadoop-mapreduce-examples-3.3.1.jar 파일에 wordcount를 이용하여, LICENSE.txt 의 파일내용의 단어를 count하여 결과값을 wordcount_output 폴더에 넣어 줄 것이다.

 

$ ls -ltr

drwxr-xr-x  2 root root      4096 Jun 21 12:48 wordcount_output

$ cd wordcount_output

$ ls -ltr

-rw-r--r-- 1 root root 9894 Jun 21 12:46 part-r-00000

-rw-r--r-- 1 root root    0 Jun 21 12:46 _SUCCESS

-> 결과 값은 part-r-00000에 존재한다.

 

7. 더 자세한 내용은 여기에서 확인

https://mungiyo.tistory.com/16

반응형

'BigData > Hadoop' 카테고리의 다른 글

hadoop 설치 & single node  (0) 2021.07.22
반응형

vi 복붙을 하는데 아래와 같은 문제가 발생되어 시간이 엄청 오래걸렸다.

Original Copy
main {
    var a=0
    var b=0
    var c=0
    var d=0
    var e=0
}
main {
    var a=0
        var b=0
            var c=0
                var d=0
                    var e=0
                         }

이런식으로 들여쓰기가 연속적으로 발생되어, 복사하는데도 시간이 오래걸리고 전혀 알아볼수없는 소스처럼 복사가 되었다.

 

해결 방법

:r!cat
복사 후
[Ctrl + D] 2번 => 빠져나올수 있다.

이 중 ":set paste" 라는 명령어로 해결을 할 수 있다고 하는데 필자는 관련 명령어가 존재하지 않았다. 아마도 리눅스에서만 해당되는 것 같다.

반응형

'Unix & Linux' 카테고리의 다른 글

tar.lzo  (0) 2023.09.25
yum 에서 설치가 되지 않을때(appstream)  (0) 2022.06.20
리눅스 폴더,파일,vi 컬러 설정  (0) 2022.06.08
사용자 계정 삭제  (0) 2022.03.18
terminal too wide  (0) 2022.01.07
반응형

1. 파일 및 폴더, 특정 확장자 변경

$ vi ~/.bashrc

export LS_COLORS="di=00;36:fi=00;37:*.gz=01;35:*.tar=00;35"

$ source ~/.bashrc

$ ls

 

위 내용을 간략하게 설명하자면

di는 directory, fi는 file, *.gz 와 *.tar는 확장자를 의미한다.

";" 를 기준으로 앞 숫자 00 일반체 01는 볼드체를 의미하며, 뒤 숫자 36은 하늘색, 37은 흰색, 35는 자주색을 의미한다.

즉 위 예시를 설명하자면

디렉토리는 일반체 하늘색로(di=00;36), 파일은 일반체로 흰색(fi=00;37), 확장자 gz, tar는 자주색으로 설정하겠다(*.gz=01;35:*.tar=00;35) 라고 이해하면 될 것같다.

 

위 예제는 예제일뿐이고 색깔과 글자모양에 대한 다양한 코드들은 구글링을 해보면 많이 나온다.

 

2. vi 문서 안에 내용들

:colo desert

vi 안에서 위 명령어를 실행시켰다면 글자가 변할 것이다. desert 라는 것은 색깔을 테마(?)별로 알아서 색을 변경해주는 이미 설정되어있는 값이라고 보면 될 것 같다. desert와 같이 테마로 된 색구성 변수도 구글링을 해보면 다양하게 나와있을 것이다.

 

다만 우리가 매번 vi를 열때마다 저 명령어를 쳐준다면 아마 귀찮을 것이다. 이것을 계속 변경을 해주고자 한다면 이렇게 하자.

$ vi ~/.vimrc

colo desert
syntax on

자동으로 설정이 될 것이다.

추가로 highlight Comment term=bold ctermfg=2 를 한다면 주석 부분의 색깔이 다르게 적용될 것이다.

반응형

'Unix & Linux' 카테고리의 다른 글

yum 에서 설치가 되지 않을때(appstream)  (0) 2022.06.20
[HP-UX] vi 자동들여쓰기(?) 문제  (0) 2022.06.17
사용자 계정 삭제  (0) 2022.03.18
terminal too wide  (0) 2022.01.07
CentOS 8 한글 입력  (0) 2021.09.12
반응형

https://comeinsidebox.com/how-to-fix-windows-10-hangul-consonant-and-vowel-separation-error/#:~:text=%ED%84%B0%EC%B9%98%20%ED%82%A4%EB%B3%B4%EB%93%9C%20%EC%95%84%EC%9D%B4%EC%BD%98%EC%9D%84%20%EB%A7%88%EC%9A%B0%EC%8A%A4,%EB%B6%84%EB%A6%AC%20%EC%98%A4%EB%A5%98%EA%B0%80%20%ED%95%B4%EA%B2%B0%20%EB%90%A9%EB%8B%88%EB%8B%A4.

 

윈도우 10 한글 입력 시 자음 모음 분리되는 문제를 해결하는 방법들 - insideBOX

윈도우에서 한글로 타이핑 시 텍스트가 정상적으로 입력 되지 않고 '자음' 과 '모음' 이 분리 되는 경우가 있습니다. 자소가 분리되는 오류가 시작 되면 특정 앱에서만 제한적으로 생기는 경우도

comeinsidebox.com

 

필자는 "window + . " 키로 해결이 되었음.

반응형
반응형

사용자의 패스워드 주기를 알고 싶을 때 쿼리

 

사용자에 적용된 profile 확인

select username,profile from dba_users where username = 'scott';

 

프로파일에 적용된 패스워드 권한 확인

select * from dba_profiles where profile = 'DEFAULT';

 

PASSWORD_LIFE_TIME:패스워드를 변경해야하는 주기

PASSWORD_REUSE_TIME:패스워드 변경시 이전 패스워드를 재사용할 수 있는 기간(즉, 해당 기간이 지나야 재사용 가능)

반응형
반응형

(1) 테스트 테이블 생성

create table split_table as
select 'a/b/c/d/e' name
from dual;

 

(2) REGEXP_SUBSTR

select regexp_substr(name,'[^/]+',1,1) regexp_substr_name1,
        regexp_substr(name,'[^/]+',1,2) regexp_substr_name2,
        regexp_substr(name,'[^/]+',1,3) regexp_substr_name3,
        regexp_substr(name,'[^/]+',1,4) regexp_substr_name4,
        regexp_substr(name,'[^/]+',1,5) regexp_substr_name5
from split_table;

결과

a b c d e

 

(3) REGEXP_REPLACE

select regexp_replace(name,'[^/]+') regexp_replace_name1,
        regexp_replace(name,'[^/]+','*') regexp_replace_name2
from split_table;

결과

//// */*/*/*/*

 

(4) 세로로 나열

select regexp_substr(name,'[^/]+',1,rownum) splite_name
from split_table
connect by rownum <= length(regexp_replace(name, '[^/]+')) +1;

결과

a
b
c
d
e

참고 : https://good4uprin.tistory.com/11

반응형
반응형

아래와 같은 테이블이 존재한다.

SQL> select name, reg_date from temp_food_info;

NAME REG_DATE
archor 2022/04/05 23:44:11
milk 2022/04/06 10:23:44
water 2022/04/07 00:00:00
chicken 2022/04/07 00:00:01
meat 2022/04/08 00:10:00

 

여기서 우리는 등록날짜가 4/6~4/7 데이터를 산출 할 것이다.

SQL> select *

from temp_food_info

where reg_date between to_date('20220406','yyyymmdd') and to_date('20220407','yyyymmdd')

;

 

결과값

NAME   REG_DATE
------- -------------------
milk      2022/04/06 10:23:44
water   2022/04/07 00:00:00

등록일이 4/7 임에도 불구하고 chicken 이 누락되었다.

이유는 날짜만 지정하였을 경우 시간대는 00:00:00으로 인식하기 때문에 4/7 00:00:00 이후 데이터는 조회가 되지 않는다.

그러므로 2022/04/07 00:00:01 에 등록된 chicken은 누락이 된 것이였다.

 

해결방법은 간단하다. 날짜 조건을 시간까지 포함 또는 그 이상의 날짜를 넣자. 

(1) 시간포함

where reg_date between to_date('2022/04/06 00:00:00','yyyy/mm/dd hh24:mi:ss')

and to_date('2022/04/07 23:59:59','yyyy/mm/dd hh24:mi:ss')

 

(2) 그 이상의 날짜

where reg_date >= to_date('20220406','yyyymmdd')

and reg_date < to_date('20220408','yyyymmdd')

 

간과하지 말고 항상 주의를 기울어야 겠다.

 

반응형

'Oracle > Oracle Study' 카테고리의 다른 글

패스워드 주기 확인  (0) 2022.04.22
[oracle19c] 사용자 생성 및 삭제 (ORA-65096, ORA-28014)  (0) 2022.03.24
11g alert 파일 경로 확인  (0) 2022.02.09
shmmax 값에 대한 추측성 글  (0) 2015.03.10
External Table  (0) 2014.07.16
반응형

(1) 생성

SQL> create user scott identified by "tiger";

ERROR at line 1:

ORA-65096: invalid common user or role name

 

SQL> create user "C##SCOTT" identified by "tiger";

-> 12c부터 바뀌 C##을 붙여줘야한다고 함. 근데 저렇게 생성하면 C##도 사용자명에 포함되버리는데 왜 저렇게 했을까나?

 

or

 

SQL> alter session set "_ORACLE_SCRIPT"=true;

SQL> create user scott identified by "tiger";

 

(2) 삭제

SQL> drop user scott [CASCADE];

여기서 ORA-28014: cannot drop administrative user or role

이런 에러가 발생된다면 _ORACLE_SCRIPT가 true로 설정 되어 있는지 확인해보자.

SQL> show parameter _oracle_script;

 

_ORACLE_SCRIPT 파라미터 값이 왜 생겼는지 의문이다.

은근 불편할뿐더러 이 파라미터 존재를 모른다면 맨땅에 헤딩하며 시간만 낭비할 것으로 보인다.

 

필자도 역시 짜증이 밀려온다 ㅎㅎ

반응형

'Oracle > Oracle Study' 카테고리의 다른 글

패스워드 주기 확인  (0) 2022.04.22
아주 쉬우면서도 착각할 수도 있는 날짜 조회  (0) 2022.04.07
11g alert 파일 경로 확인  (0) 2022.02.09
shmmax 값에 대한 추측성 글  (0) 2015.03.10
External Table  (0) 2014.07.16

+ Recent posts